lab-ansible/site.yml

35 lines
905 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
hosts: all
2023-11-15 19:30:53 +00:00
remote_user: ansible
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
hostname in groups['proxyservers']
- name: Include role 'apps'
ansible.builtin.include_role:
name: apps
when: hostname in groups['appservers']
- 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']