lab-ansible/site.yml

36 lines
995 B
YAML
Raw Normal View History

2023-10-28 23:49:29 +00:00
# vim: ft=yaml.ansible
2023-10-29 19:46:52 +00:00
# code: language=ansible
2023-10-28 23:49:29 +00:00
---
2024-01-02 18:28:06 +00:00
- name: Run playbook
2024-02-04 14:31:18 +00:00
hosts: virtualservers
2023-11-15 19:30:53 +00:00
become: true
2023-12-29 18:59:58 +00:00
gather_facts: true
2024-01-02 18:28:06 +00:00
tasks:
- name: Include role 'virt-common'
ansible.builtin.include_role:
name: virt-common
when: hostname in groups['virtualservers']
- name: Include role 'docker'
ansible.builtin.include_role:
name: docker
when: hostname in groups['appservers'] or
2024-02-04 14:31:18 +00:00
hostname in groups['proxyservers'] or
hostname in groups['publicservers']
2024-01-02 18:28:06 +00:00
- name: Include role 'apps'
ansible.builtin.include_role:
name: apps
2024-02-04 15:34:29 +00:00
when: hostname in groups['appservers'] or
hostname in groups['publicservers']
2024-01-02 18:28:06 +00:00
- name: Include role 'postgresql'
ansible.builtin.include_role:
name: postgresql
when: hostname in groups['dbservers']
- name: Include role 'proxy'
ansible.builtin.include_role:
name: proxy
when: hostname in groups['proxyservers']