risotto/ansible/playbook.yml

36 lines
1 KiB
YAML
Raw Normal View History

2022-10-01 22:33:11 +02:00
---
- name: Risotto
2022-12-21 16:35:58 +01:00
hosts: all
2022-10-01 22:33:11 +02:00
tasks:
2023-01-23 20:23:32 +01:00
- name: "Build host files"
rougail:
hostname: "{{ vars['inventory_hostname'] }}"
only_machine: "{{ only_machine }}"
configure_host: "{{ configure_host }}"
copy_tests: "{{ copy_tests }}"
copy_templates: "{{ copy_templates }}"
register: build_host
2023-06-22 16:15:29 +02:00
- name: "Change"
2023-02-27 14:03:56 +01:00
ansible.builtin.debug:
var: build_host
2022-10-01 22:33:11 +02:00
- name: "Configure the host"
include_tasks: host.yml
when: configure_host == true
2023-01-23 20:23:32 +01:00
2022-10-01 22:33:11 +02:00
- name: "Prepare machine configuration"
include_tasks: machine.yml
2023-01-23 20:23:32 +01:00
when: item.name in build_host.machines_changed
2022-10-01 22:33:11 +02:00
loop: "{{ vars | machineslist(only=only_machine) }}"
2023-02-27 14:03:56 +01:00
2023-01-23 20:23:32 +01:00
# - name: "Remove images"
# include_tasks: remove_image.yml
# loop: "{{ vars | machineslist(only=only_machine) }}"
# when: delete_old_image == true
#
2022-10-01 22:33:11 +02:00
- name: "Install and apply configurations"
include_tasks: machines.yml
2023-06-22 16:15:29 +02:00
vars:
machines_changed: "{{ build_host.machines_changed }}"