diff --git a/Inventory/group_vars/all.yaml b/Inventory/group_vars/all.yaml deleted file mode 100644 index b4a2c4f..0000000 --- a/Inventory/group_vars/all.yaml +++ /dev/null @@ -1 +0,0 @@ -ansible_python_interpreter: /usr/bin/python3 \ No newline at end of file diff --git a/Inventory/hosts.yaml b/Inventory/hosts.yaml index fd5eff8..b587eaa 100644 --- a/Inventory/hosts.yaml +++ b/Inventory/hosts.yaml @@ -8,7 +8,6 @@ all: ansible_user: truenas_admin network: ansible_host: 192.168.1.253 - ansible_port: 9 ansible_user: root mailcow: ansible_host: 192.168.1.200 @@ -19,9 +18,6 @@ all: compute-1: ansible_host: 192.168.2.3 ansible_user: root - cloud: - ansible_host: 192.168.2.7 - ansible_user: root children: fedora: @@ -31,15 +27,13 @@ all: compute-1: debian: hosts: + pve-R730-3GDWF82: + truenas: mailcow: - cloud: docker: hosts: compute-0: compute-1: pve: hosts: - pve-R730-3GDWF82: - nas: - hosts: - truenas: \ No newline at end of file + pve-R730-3GDWF82: \ No newline at end of file diff --git a/Playbooks/machine-update/README.md b/Playbooks/machine-update/README.md deleted file mode 100644 index f896b31..0000000 --- a/Playbooks/machine-update/README.md +++ /dev/null @@ -1,7 +0,0 @@ -# Required packages -### Fedora - -- python3-libdnf5 -```shell -dnf install python3-libdnf5 -``` diff --git a/Playbooks/machine-update/update-debian-hosts.yaml b/Playbooks/machine-update/update-debian-hosts.yaml deleted file mode 100644 index b0348d6..0000000 --- a/Playbooks/machine-update/update-debian-hosts.yaml +++ /dev/null @@ -1,5 +0,0 @@ -- name: update APT packages - apt: - upgrade: yes - update_cache: yes - cache_valid_time: 86400 \ No newline at end of file diff --git a/Playbooks/machine-update/update-fedora-hosts.yaml b/Playbooks/machine-update/update-fedora-hosts.yaml deleted file mode 100644 index ea0d2e7..0000000 --- a/Playbooks/machine-update/update-fedora-hosts.yaml +++ /dev/null @@ -1,4 +0,0 @@ -- name: Upgrade all packages - ansible.builtin.dnf: - name: "*" - state: latest \ No newline at end of file diff --git a/Playbooks/machine-update/update-machines.yaml b/Playbooks/machine-update/update-machines.yaml deleted file mode 100644 index 7deb571..0000000 --- a/Playbooks/machine-update/update-machines.yaml +++ /dev/null @@ -1,10 +0,0 @@ ---- -- hosts: fedora - tasks: - - name: Update fedora hosts - include_tasks: update-fedora-hosts.yaml - -- hosts: debian - tasks: - - name: Update debian hosts - include_tasks: update-debian-hosts.yaml diff --git a/Playbooks/truenas/README.md b/Playbooks/truenas/README.md deleted file mode 100644 index cae8aba..0000000 --- a/Playbooks/truenas/README.md +++ /dev/null @@ -1,2 +0,0 @@ -# Git -https://github.com/fanuelsen/ansible/tree/master/ansible-truenas-api \ No newline at end of file diff --git a/Playbooks/truenas/update-truenas-tasks.yaml b/Playbooks/truenas/update-truenas-tasks.yaml deleted file mode 100644 index 6d4992a..0000000 --- a/Playbooks/truenas/update-truenas-tasks.yaml +++ /dev/null @@ -1,61 +0,0 @@ -- name: Checks if there is an update available from update server. - uri: - method: POST - url: https://{{ item.ip }}/api/v2.0/update/check_available - return_content: true - validate_certs: '{{ item.validate_certs }}' - headers: - Content-Type: application/json - Authorization: 'Bearer {{ item.token }}' - register: truenas_pending_updates - -- name: Downloads (if not already in cache) and apply an update. - uri: - method: POST - url: https://{{ item.ip }}/api/v2.0/update/update - return_content: true - validate_certs: '{{ item.validate_certs }}' - headers: - Content-Type: application/json - Authorization: 'Bearer {{ item.token }}' - when: "truenas_pending_updates.json.status == 'AVAILABLE'" - -- name: Wait for update to finish. - uri: - method: POST - url: https://{{ item.ip }}/api/v2.0/update/check_available - return_content: true - validate_certs: '{{ item.validate_certs }}' - headers: - Content-Type: application/json - Authorization: 'Bearer {{ item.token }}' - register: truenas_reboot_required - when: "truenas_pending_updates.json.status == 'AVAILABLE' or truenas_pending_updates.json.status == 'REBOOT_REQUIRED'" - until: "(truenas_reboot_required.json|default(dict(status=WAITING))).status == 'REBOOT_REQUIRED'" - retries: 20 - delay: 30 - -- name: Reboot host - uri: - method: POST - url: https://{{ item.ip }}/api/v2.0/system/reboot - return_content: true - validate_certs: '{{ item.validate_certs }}' - headers: - Content-Type: application/json - Authorization: 'Bearer {{ item.token }}' - when: truenas_reboot_required.json.status | default (false) == 'REBOOT_REQUIRED' - -- name: Returns whether the system completed boot and is ready to use. - uri: - method: GET - url: https://{{ item.ip }}/api/v2.0/system/state - return_content: true - validate_certs: '{{ item.validate_certs }}' - headers: - Content-Type: application/json - Authorization: 'Bearer {{ item.token }}' - register: truenas_system_ready - until: truenas_system_ready.content == '"READY"' - retries: 20 - delay: 30 \ No newline at end of file diff --git a/Playbooks/truenas/update-truenas.yaml b/Playbooks/truenas/update-truenas.yaml deleted file mode 100644 index e1f816b..0000000 --- a/Playbooks/truenas/update-truenas.yaml +++ /dev/null @@ -1,14 +0,0 @@ ---- -- hosts: truenas - gather_facts: false - - vars: - sites: - - ip: 192.168.3.1 - token: 1-gAIQbRICSPPqM1JCsfofc8gJgLvV8SglXV2xemYzBr2rzdZvQd5J0pMYeG45Jiqx - validate_certs: false - - tasks: - - name: update-truenas-api - include_tasks: update-truenas-tasks.yaml - loop: '{{ sites }}' \ No newline at end of file diff --git a/Playbooks/update-apt.yaml b/Playbooks/update-apt.yaml new file mode 100644 index 0000000..03f05fb --- /dev/null +++ b/Playbooks/update-apt.yaml @@ -0,0 +1,8 @@ +--- + +- hosts: debian + tasks: + - name: update APT packages + apt: + upgrade: yes + update_cache: yes \ No newline at end of file diff --git a/Playbooks/update-dnf.yaml b/Playbooks/update-dnf.yaml new file mode 100644 index 0000000..94cc1fe --- /dev/null +++ b/Playbooks/update-dnf.yaml @@ -0,0 +1,8 @@ +--- + +- hosts: fedora + tasks: + - name: Upgrade all packages + ansible.builtin.dnf: + name: "*" + state: latest \ No newline at end of file