ansible-course/09-roles/site.yml

40 lines
600 B
YAML
Raw Permalink Normal View History

2024-07-14 05:10:41 +02:00
---
- hosts: all
become: true
pre_tasks:
- name: install updates for RHEL distros
tags: always
package:
update_only: yes
update_cache: yes
when: ansible_os_family == "RedHat"
- name: install updates for Debian distros
tags: always
package:
upgrade: dist
update_cache: yes
when: ansible_os_family == "Debian"
- hosts: all
become: true
roles:
- base
- hosts: web_servers
become: true
tags: web
roles:
- web_servers
- hosts: db_servers
tags: db,
become: true
roles:
- db_servers