From: Oleg Broytman Date: Sun, 28 Jul 2019 16:25:06 +0000 (+0300) Subject: Feat: Declare dependencies between roles X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=47138ce7977f2b88a41866ccd988fd0eed311df4;p=ansible.git Feat: Declare dependencies between roles Also remove dependent roles from playbooks. --- diff --git a/playbooks/debian/init-system.yml b/playbooks/debian/init-system.yml index 1015ebd..ad82015 100644 --- a/playbooks/debian/init-system.yml +++ b/playbooks/debian/init-system.yml @@ -2,6 +2,5 @@ hosts: "{{ hosts | default('servers') }}" gather_facts: false roles: - - init-system - sudo - phd diff --git a/playbooks/debian/roles/add-apache-vhost/meta/main.yml b/playbooks/debian/roles/add-apache-vhost/meta/main.yml index 342147e..99e61b3 100644 --- a/playbooks/debian/roles/add-apache-vhost/meta/main.yml +++ b/playbooks/debian/roles/add-apache-vhost/meta/main.yml @@ -1 +1 @@ -dependencies: ['install-dehydrated'] +dependencies: ['apache', 'install-dehydrated'] diff --git a/playbooks/debian/roles/apache/meta/main.yml b/playbooks/debian/roles/apache/meta/main.yml new file mode 100644 index 0000000..ee83d2b --- /dev/null +++ b/playbooks/debian/roles/apache/meta/main.yml @@ -0,0 +1 @@ +dependencies: ['firewall', 'logcheck'] diff --git a/playbooks/debian/roles/install-dehydrated/meta/main.yml b/playbooks/debian/roles/install-dehydrated/meta/main.yml new file mode 100644 index 0000000..c84c3cf --- /dev/null +++ b/playbooks/debian/roles/install-dehydrated/meta/main.yml @@ -0,0 +1 @@ +dependencies: ['apache'] diff --git a/playbooks/debian/roles/phd/meta/main.yml b/playbooks/debian/roles/phd/meta/main.yml new file mode 100644 index 0000000..8f82bb2 --- /dev/null +++ b/playbooks/debian/roles/phd/meta/main.yml @@ -0,0 +1 @@ +dependencies: ['init-system'] diff --git a/playbooks/debian/roles/root/meta/main.yml b/playbooks/debian/roles/root/meta/main.yml new file mode 100644 index 0000000..3c93994 --- /dev/null +++ b/playbooks/debian/roles/root/meta/main.yml @@ -0,0 +1 @@ +dependencies: ['phd'] diff --git a/playbooks/debian/roles/sudo/meta/main.yml b/playbooks/debian/roles/sudo/meta/main.yml new file mode 100644 index 0000000..8f82bb2 --- /dev/null +++ b/playbooks/debian/roles/sudo/meta/main.yml @@ -0,0 +1 @@ +dependencies: ['init-system']