From 1c199082c64317a9451d6e69f98f4aea279ab2f7 Mon Sep 17 00:00:00 2001 From: vincent Date: Sat, 23 Dec 2023 10:58:45 +0100 Subject: [PATCH] feat: variable file by env squash --- ansible/group_vars/VPS/VPS | 45 ++++++++++++++++++++++++++++++++ ansible/group_vars/VPS/mount | 13 ++++++--- ansible/group_vars/homelab/mount | 38 +++++++++++++-------------- ansible/group_vars/production | 4 +++ ansible/group_vars/staging | 12 +++++++-- 5 files changed, 88 insertions(+), 24 deletions(-) create mode 100644 ansible/group_vars/VPS/VPS diff --git a/ansible/group_vars/VPS/VPS b/ansible/group_vars/VPS/VPS new file mode 100644 index 0000000..14e07d2 --- /dev/null +++ b/ansible/group_vars/VPS/VPS @@ -0,0 +1,45 @@ +# defaults file for ansible-arch-provissionning +partition_table: + - device: "/dev/sda" + label: gpt + settings: + - number: 1 + part_end: 64MB + flags: [boot, esp] + fstype: vfat + format: yes + - number: 2 + part_start: 512MB + part_end: 1524MB + flags: [] + fstype: swap + format: yes + - number: 3 + part_start: 1524MB + flags: [lvm] + fstype: ext4 + format: yes + #- device: "/dev/sdb" + #settings: + #- number: 1 + #name: home + #fstype: ext4 + #format: +mount_table: + - device: "/dev/sda" + settings: + - number: 3 + mountpath: /mnt + fstype: ext4 + - number: 1 + mountpath: /mnt/boot + fstype: vfat + +#need vfat boot partition with esp label +provissionning_UEFI_Enable: True +#sssd_configure: False +nomad_datacenter: hetzner + +consul_server: False +nomad_server: False + diff --git a/ansible/group_vars/VPS/mount b/ansible/group_vars/VPS/mount index c664e4a..74252db 100644 --- a/ansible/group_vars/VPS/mount +++ b/ansible/group_vars/VPS/mount @@ -1,11 +1,11 @@ systemd_mounts: diskstation_nomad: - share: "{{ nas_ip }}:/volume2/nomad" + share: "{{ nas_ip }}:{{ env_default_nfs_path }}/nomad" mount: /mnt/diskstation/nomad type: nfs options: - " " - automount: true + automount: "{{ env_automount }}" hetzner_storage: share: //u304977.your-storagebox.de/backup mount: /mnt/hetzner/storagebox @@ -16,7 +16,14 @@ systemd_mounts: - gid= 10 - vers=3.0 - mfsymlinks - automount: true + automount: "{{ env_automount }}" + +credentials_files: + 1: + type: smb + path: /etc/creds/hetzner_credentials + username: u304977 + password: "{{ lookup('hashi_vault','secret=secrets/data/ansible/storage:hetzner') }}" systemd_mounts_enabled: - diskstation_nomad diff --git a/ansible/group_vars/homelab/mount b/ansible/group_vars/homelab/mount index e20fd46..dde5915 100644 --- a/ansible/group_vars/homelab/mount +++ b/ansible/group_vars/homelab/mount @@ -1,74 +1,74 @@ systemd_mounts: diskstation_git: - share: "{{ nas_ip }}:/volume2/git" + share: "{{ nas_ip }}:{{ env_default_nfs_path }}//git" mount: /mnt/diskstation/git type: nfs options: - " " - automount: true + automount: "{{ env_automount }}" diskstation_CardDav: - share: "{{ nas_ip }}:/volume2/CardDav" + share: "{{ nas_ip }}:{{ env_default_nfs_path }}/CardDav" mount: /mnt/diskstation/CardDav type: nfs options: - " " - automount: true + automount: "{{ env_automount }}" backup_disk: share: /dev/sdb1 mount: /mnt/backup type: ntfs-3g options: - " " - automount: true + automount: "{{ env_automount }}" diskstation_home: - share: "{{ nas_ip }}:/volume2/homes/admin" + share: "{{ nas_ip }}:{{ env_default_nfs_path }}/homes/admin" mount: /mnt/diskstation/home type: nfs options: - " " - automount: true + automount: "{{ env_automount }}" diskstation_photo: - share: "{{ nas_ip }}:/volume2/photo" + share: "{{ nas_ip }}:{{ env_default_nfs_path }}/photo" mount: /mnt/diskstation/photo type: nfs options: - " " - automount: true + automount: "{{ env_automount }}" diskstation_music: - share: "{{ nas_ip }}:/volume2/music" + share: "{{ nas_ip }}:{{ env_default_nfs_path }}/music" mount: /mnt/diskstation/music type: nfs options: - " " - automount: true + automount: "{{ env_automount }}" diskstation_media: - share: "{{ nas_ip }}:/volume1/media" + share: "{{ nas_ip }}:{{ env_default_nfs_path }}/media" mount: /mnt/diskstation/media type: nfs options: - " " - automount: true + automount: "{{ env_automount }}" diskstation_ebook: - share: "{{ nas_ip }}:/volume2/ebook" + share: "{{ nas_ip }}:{{ env_default_nfs_path }}/ebook" mount: /mnt/diskstation/ebook type: nfs options: - " " - automount: true + automount: "{{ env_automount }}" diskstation_archMirror: - share: "{{ nas_ip }}:/volume2/archMirror" + share: "{{ nas_ip }}:{{ env_default_nfs_path }}/archMirror" mount: /mnt/diskstation/archMirror type: nfs options: - " " - automount: true + automount: "{{ env_automount }}" diskstation_nomad: - share: "{{ nas_ip }}:/volume2/nomad" + share: "{{ nas_ip }}:{{ env_default_nfs_path }}/nomad" mount: /mnt/diskstation/nomad type: nfs options: - " " - automount: true + automount: "{{ env_automount }}" systemd_mounts_enabled: - diskstation_git diff --git a/ansible/group_vars/production b/ansible/group_vars/production index ae12151..5840fd7 100644 --- a/ansible/group_vars/production +++ b/ansible/group_vars/production @@ -1,6 +1,10 @@ +<<<<<<< HEAD domain: name: ducamps.eu consul_bootstrap_expect: 3 consul_domain: "consul" nomad_bootstrap_expect: 3 vault_unseal_keys_dir_output: "~/vaultUnseal/production" +env_default_nfs_path: "/volume2" +env_media_nfs_path: "/volume1" +env_automount: true diff --git a/ansible/group_vars/staging b/ansible/group_vars/staging index f07223c..84a48f0 100644 --- a/ansible/group_vars/staging +++ b/ansible/group_vars/staging @@ -1,8 +1,16 @@ +<<<<<<< HEAD domain: name: ducamps-dev.win -systemd_mounts: [] -systemd_mounts_enabled: [] +#systemd_mounts: [] +#systemd_mounts_enabled: [] consul_bootstrap_expect: 2 consul_domain: "consul" nomad_bootstrap_expect: 2 vault_unseal_keys_dir_output: "~/vaultUnseal/staging" +hosts_entries: + - ip: "{{ hostvars['nas-dev']['ansible_default_ipv4']['address'] }}" + name: diskstation.ducamps.win + +env_default_nfs_path: "/var/local/volume1" +env_media_nfs_path: "{{ env_default_nfs_path }}" +env_automount: false