From 09d6c932245661f0c10f0eadee9ddb7a5d9acc52 Mon Sep 17 00:00:00 2001 From: michael Date: Mon, 24 Oct 2022 21:53:39 +1300 Subject: [PATCH] adding credentials --- ansible/ansible.cfg | 3 +- .../inventory/host_vars/kube01/kube01.yaml | 2 + .../inventory/host_vars/kube02/kube02.yaml | 2 + .../inventory/host_vars/kube03/kube03.yaml | 2 + .../inventory/host_vars/server/server.yaml | 1 + ansible/inventory/inventory.yaml | 73 ++++++------------- ...02_vm_template.yaml => 02_vm_template.yml} | 0 notes/ansible_cheat_sheet.txt | 13 ++++ 8 files changed, 46 insertions(+), 50 deletions(-) create mode 100644 ansible/inventory/host_vars/kube01/kube01.yaml create mode 100644 ansible/inventory/host_vars/kube02/kube02.yaml create mode 100644 ansible/inventory/host_vars/kube03/kube03.yaml rename ansible/playbooks/{02_vm_template.yaml => 02_vm_template.yml} (100%) create mode 100644 notes/ansible_cheat_sheet.txt diff --git a/ansible/ansible.cfg b/ansible/ansible.cfg index 8d82805..6cc602f 100644 --- a/ansible/ansible.cfg +++ b/ansible/ansible.cfg @@ -8,4 +8,5 @@ interpreter_python = auto_silent collections_paths = ./collections collections_path = ./collections roles_path = ./roles -vault_password_file = ./vault_password \ No newline at end of file +vault_password_file = ./vault_password +playbook_dir = ./playbooks/ diff --git a/ansible/inventory/host_vars/kube01/kube01.yaml b/ansible/inventory/host_vars/kube01/kube01.yaml new file mode 100644 index 0000000..9ddf8a1 --- /dev/null +++ b/ansible/inventory/host_vars/kube01/kube01.yaml @@ -0,0 +1,2 @@ +--- +ansible_host: kube01.balsillie.net \ No newline at end of file diff --git a/ansible/inventory/host_vars/kube02/kube02.yaml b/ansible/inventory/host_vars/kube02/kube02.yaml new file mode 100644 index 0000000..e3672bc --- /dev/null +++ b/ansible/inventory/host_vars/kube02/kube02.yaml @@ -0,0 +1,2 @@ +--- +ansible_host: kube02.balsillie.net \ No newline at end of file diff --git a/ansible/inventory/host_vars/kube03/kube03.yaml b/ansible/inventory/host_vars/kube03/kube03.yaml new file mode 100644 index 0000000..02a636e --- /dev/null +++ b/ansible/inventory/host_vars/kube03/kube03.yaml @@ -0,0 +1,2 @@ +--- +ansible_host: kube03.balsillie.net \ No newline at end of file diff --git a/ansible/inventory/host_vars/server/server.yaml b/ansible/inventory/host_vars/server/server.yaml index 6589c92..ae5bb20 100644 --- a/ansible/inventory/host_vars/server/server.yaml +++ b/ansible/inventory/host_vars/server/server.yaml @@ -2,6 +2,7 @@ # connection +ansible_host: server.balsillie.net ansible_user: michael ansible_become_user: michael ansible_os_family: Arch \ No newline at end of file diff --git a/ansible/inventory/inventory.yaml b/ansible/inventory/inventory.yaml index 0db15e9..3d2f363 100644 --- a/ansible/inventory/inventory.yaml +++ b/ansible/inventory/inventory.yaml @@ -4,81 +4,56 @@ all: children: hypervisors: hosts: - - server - - lab - - hv00 + server: + lab: + hv00: vms: children: nodes: hosts: - - node1 - - node2 - - node3 + node1: + node2: + node3: hosts: - - router + router: hetzner: hosts: - - hv00 - - firewall00 + hv00: + fw00: k8s: children: k8s_control: hosts: - - kube00 - - kube01 - - kube02 + kube00: + kube01: + kube02: k8s_taint: hosts: - - kube00 - - kube01 - - kube02 + kube00: + kube01: + kube02: k8s_worker: hosts: - - kube00 - - kube01 - - kube02 + kube00: + kube01: + kube02: firewalls: children: fortigate: hosts: - - fortigate00 + fortigate00: opnsense: hosts: - - firewall00 + fw00: switches: hosts: - - switch00 + sw00: workstations: children: arch: hosts: - - lat5420 - - sff + lat5420: + sff: windows: hosts: - - bridie - hosts: - server: - ansible_host: server.balsillie.net - lab: - ansible_host: lab.balsillie.net - hv00: - ansible_host: server.balsillie.net - bridie: - ansible_host: bridie.balsillie.net - lat5420: - ansible_host: lat5420.balsillie.net - sff: - ansible_host: sff.balsillie.net - node1: - ansible_host: node1.balsillie.net - node2: - ansible_host: node2.balsillie.net - node3: - ansible_host: node3.balsillie.net - router: - ansible_host: router.balsillie.net - firewall00: - ansible_host: firewall.balsillie.net - fortigate00: - ansible_host: fortigate.balsillie.net + bridie: \ No newline at end of file diff --git a/ansible/playbooks/02_vm_template.yaml b/ansible/playbooks/02_vm_template.yml similarity index 100% rename from ansible/playbooks/02_vm_template.yaml rename to ansible/playbooks/02_vm_template.yml diff --git a/notes/ansible_cheat_sheet.txt b/notes/ansible_cheat_sheet.txt new file mode 100644 index 0000000..1c296e9 --- /dev/null +++ b/notes/ansible_cheat_sheet.txt @@ -0,0 +1,13 @@ +cd ./ansible + +# Ansible vault password is provided automatically by vault_password file +# Path to vault_password file is provided automatically by ansible.cfg +# Hence execution must be done from the context of the folder that holds ansible.cfg + + +ansible-vault create [path-to-vault-file] +ansibe-vault edit [path-to-vault-file] + + + +ansible-playbook [path-to-playbook] #include file extension \ No newline at end of file