diff options
author | binary <me@rgoncalves.se> | 2020-11-18 09:38:36 +0100 |
---|---|---|
committer | binary <me@rgoncalves.se> | 2020-11-18 09:38:36 +0100 |
commit | 541d963cca366cb4541de26c8b691a2b273cfa94 (patch) | |
tree | e523ce2316a747f828d80e35a2ad42042ffd6b3b | |
parent | 9f69010653dfdb6b76f60775642cd77f734f80ac (diff) | |
download | infrastructure-541d963cca366cb4541de26c8b691a2b273cfa94.tar.gz |
Refactor group/host/inventory in sub-files
-rw-r--r-- | group_vars/alpine.yml | 18 | ||||
-rw-r--r-- | group_vars/debian.yml | 18 | ||||
-rw-r--r-- | group_vars/freebsd.yml | 19 | ||||
-rw-r--r-- | group_vars/openbsd.yml | 19 | ||||
-rw-r--r-- | host_vars/dcontroller.yml | 16 | ||||
-rw-r--r-- | host_vars/emb0.yml | 13 | ||||
-rw-r--r-- | host_vars/stack0.yml | 30 | ||||
-rw-r--r-- | host_vars/template | 12 | ||||
-rw-r--r-- | inventory.ini | 27 | ||||
-rw-r--r-- | inventory.yml | 71 |
10 files changed, 172 insertions, 71 deletions
diff --git a/group_vars/alpine.yml b/group_vars/alpine.yml new file mode 100644 index 0000000..8e529c0 --- /dev/null +++ b/group_vars/alpine.yml @@ -0,0 +1,18 @@ + +# alpine.yml ~~ group_vars/ +# alpine machines + +--- + +ansible_become_method: "sudo" + +user_op: "puffy" + +group_root: "root" + +path_zsh: "/usr/bin/zsh" +path_zshconfig: "/etc/zsh/zshrc" +path_tmuxconfig: "/etc/tmux.conf" + +os_type: "linux" +os_distribution: "alpine" diff --git a/group_vars/debian.yml b/group_vars/debian.yml new file mode 100644 index 0000000..f8bcf20 --- /dev/null +++ b/group_vars/debian.yml @@ -0,0 +1,18 @@ + +# alpine.yml ~~ group_vars/ +# alpine machines + +--- + +ansible_become_method: "sudo" + +user_op: "puffy" + +group_root: "root" + +path_zsh: "/usr/bin/zsh" +path_zshconfig: "/etc/zsh/zshrc" +path_tmuxconfig: "/etc/tmux.conf" + +os_type: "linux" +os_distribution: "debian" diff --git a/group_vars/freebsd.yml b/group_vars/freebsd.yml new file mode 100644 index 0000000..fc86360 --- /dev/null +++ b/group_vars/freebsd.yml @@ -0,0 +1,19 @@ + +# freebsd.yml ~~ group_vars/ +# freebsd machines + +--- + +ansible_become_method: "doas" + +user_op: "puffy" + +group_root: "wheel" + +path_zsh: "/usr/local/bin/zsh" +path_zshconfig: "/usr/local/etc/zshrc" +path_tmuxconfig: "/usr/local/etc/tmux.conf" + +os_type: "bsd" +os_distribution: "freebsd" + diff --git a/group_vars/openbsd.yml b/group_vars/openbsd.yml new file mode 100644 index 0000000..520160b --- /dev/null +++ b/group_vars/openbsd.yml @@ -0,0 +1,19 @@ + +# openbsd.yml ~~ group_vars/ +# openbsd machines + +--- + +ansible_become_method: "doas" + +user_op: "puffy" + +group_root: "wheel" + +path_zsh: "/usr/local/bin/zsh" +path_zshconfig: "/etc/zshrc" +path_tmuxconfig: "/etc/tmux.conf" + +os_type: "bsd" +os_distribution: "openbsd" + diff --git a/host_vars/dcontroller.yml b/host_vars/dcontroller.yml new file mode 100644 index 0000000..b891cc2 --- /dev/null +++ b/host_vars/dcontroller.yml @@ -0,0 +1,16 @@ +hostname: dcontroller +virtual: true + +ip: + in: 10.10.0.1 + out: 192.168.5.1 + +services: + + - name: "ssh" + proto: "tcp" + port: "22" + + - name: "wireguard" + proto: "udp" + port: "53" diff --git a/host_vars/emb0.yml b/host_vars/emb0.yml new file mode 100644 index 0000000..d135429 --- /dev/null +++ b/host_vars/emb0.yml @@ -0,0 +1,13 @@ +hostname: emb0 +virtual: false + +ip: + in: 10.10.0.40 + out: 192.168.5.40 + +services: + + - name: "ssh" + proto: "tcp" + port: "22" + diff --git a/host_vars/stack0.yml b/host_vars/stack0.yml new file mode 100644 index 0000000..051908b --- /dev/null +++ b/host_vars/stack0.yml @@ -0,0 +1,30 @@ +hostname: stack0 +ip: + in: 10.10.0.40 + out: 192.168.5.40 + +virtual: false + +services: + + - name: "ssh" + proto: "tcp" + port: "22" + +vms: + + - name: vm0 + memory: 2G + disks: + - { size: "4G" } + + - name: vm1 + memory: 2G + disks: + - { size: "4G" } + + - name: vm1 + memory: 2G + disks: + - { size: "4G" } + diff --git a/host_vars/template b/host_vars/template new file mode 100644 index 0000000..7eaa472 --- /dev/null +++ b/host_vars/template @@ -0,0 +1,12 @@ +hostname: required;string +ip: + in: required;string + out: required;string + +virtual: required;bool + +vms: + - name: required;string + memory: required;string + disks: + - { size: required;string } diff --git a/inventory.ini b/inventory.ini new file mode 100644 index 0000000..aa666bd --- /dev/null +++ b/inventory.ini @@ -0,0 +1,27 @@ + +# inventory.ini +# +# --- + +# all hosts + +# groups + +[servers] +dcontroller +stack0 +emb0 + +[openbsd] +dcontroller + +[freebsd] +stack0 + +[debian] +emb0 + +[alpine] +vm0 +vm1 + diff --git a/inventory.yml b/inventory.yml index e715339..06fe97e 100644 --- a/inventory.yml +++ b/inventory.yml @@ -14,18 +14,6 @@ all: - 8.8.8.8 - 8.8.4.4 - packages: - zsh: "zsh" - curl: "curl" - tmux: "tmux" - wget: "wget" - figlet: "figlet" - neovim: "neovim" - pip: "pip3" - - group: - root: "root" - ansible_port: "22" ansible_python_interpreter: "/usr/bin/python3" @@ -35,53 +23,9 @@ all: # --- hosts: - # SERVER for domain controller dcontroller: - ansible_host: "dcontroller" - ip: { in: "10.10.0.1", out: "185.203.114.234" } - services: - - { name: "ssh", proto: "tcp", port: "22", public: true } - - { name: "httpd", proto: "tcp", port: "80", public: true, domain: "www" } - - { name: "wireguard", proto: "udp", port: "53", public: true } - - # SERVER for vm stack0: - ansible_host: "stack0" - ip: { in: "10.10.0.40", out: "192.168.5.40" } - services: - - { name: "ssh", proto: "tcp", port: "22" } - vms: - - { name: "vm0", iso: "alpine", memory: "6G", size: "4G", enabled: true } - - { name: "vm1", iso: "alpine", memory: "2G", size: "4G", enabled: true } - hypervisor: - enabled: "true" - interface: "bnx0" - switch: "bridge0" - gateway: "192.168.5.1" - mask: "255.255.255.0" - - # SERVER for personnal file sync emb0: - ansible_host: "emb0" - ip: { in: "10.10.0.41", out: "192.168.5.41" } - services: - - { name: "ssh", proto: "tcp", port: "22" } - - { name: "syncthing", proto: "tcp", port: "8384" } - - # VM - vm0: - ansible_host: "vm0" - ip: { in: "10.10.0.60", out: "192.168.5.60" } - services: - - { name: "ssh", proto: "tcp", port: "22" } - - { name: "minecraft", proto: "tcp, udp", port: "25565", public: true } - - vm1: - ansible_host: "vm1" - ip: { in: "10.10.0.61", out: "192.168.5.61" } - services: - - { name: "ssh", proto: "tcp", port: "22"} - - { name: "nextcloud", proto: "tcp", port: "8080", public: true, domain: "cloud" } # CLIENTS graphite: @@ -109,21 +53,6 @@ all: dcontroller: stack0: emb0: - vm0: - vm1: - - # GROUP physical - ph: - hosts: - dcontroller: - stack0: - emb0: - - # GROUP virtual machine - vm: - hosts: - vm0: - vm1: # GROUP openbsd openbsd: |