Refactor ansible hosts.yml: Update hosts to include all servers

This commit is contained in:
2024-09-23 21:16:36 +08:00
parent b82705c3a7
commit ecae976f3b
3 changed files with 13 additions and 1 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
---
- name: Update APT package list and upgrade packages
# hosts: "dc00,dc01,dc02,dc03,dc04,dc05,dc09"
hosts: prod
hosts: all
become: true
become_method: su
+11
View File
@@ -17,3 +17,14 @@ dev:
hosts:
dev302:
ansible_host: 192.168.1.10
ansible_user: user
ansible_become_method: sudo
dev301:
ansible_host: 192.168.50.71
ansible_user: user
ansible_become_method: sudo
virtual:
children:
backend:
dev:
+1
View File
@@ -3,4 +3,5 @@
## Update all packages
```bash
ansible-playbook -i inventory playbooks/update/update-noreboot.yml -l '!dc08' -K
ansible-playbook -i inventory playbooks/update/update-noreboot.yml -l 'prod' -K
```