all machines incorporated into ansible

This commit is contained in:
Ibrahim Mkusa 2024-09-05 23:36:20 -04:00
parent 9a5e0a2b3a
commit b9f0d39bf8
2 changed files with 20 additions and 8 deletions

View File

@ -6,7 +6,7 @@ doc ansible_user=pollen
[local] [local]
proxmox ansible_user=root proxmox ansible_user=root
dns ansible_user=pollen pihole ansible_user=pollen
[servers:children] [servers:children]
doc doc

View File

@ -15,12 +15,6 @@
state: latest state: latest
notify: reboot notify: reboot
- name: Upgrade pihole on dns using docker compose
community.docker.docker_compose:
project_src: /home/pollen/pihole
state: present
recreate: always
handlers: handlers:
- name: reboot - name: reboot
@ -33,9 +27,27 @@
tasks: tasks:
- name: update package index on local machine - name: update package index on local machine
ansible.builtin.apt: ansible.builtin.apt:
update_cache: yes update_cache: true
- name: update all packages to latest version - name: update all packages to latest version
ansible.builtin.apt: ansible.builtin.apt:
name: "*" name: "*"
state: latest state: latest
- name: Upgrade pihole on dns using docker compose
hosts: pihole
tasks:
- name: pull new images via docker compose
command:
cmd: docker compose -f pihole_compose.yml pull
chdir: /home/pollen/pihole
- name: remove the currently running container
command:
cmd: docker compose -f pihole_compose.yml down
chdir: /home/pollen/pihole
- name: bring back pihole container
command:
cmd: docker compose -f pihole_compose.yml up -d
chdir: /home/pollen/pihole