]> git.phdru.name Git - ansible.git/commitdiff
Refactor: Move OS-specific roles under common `roles/`
authorOleg Broytman <phd@phdru.name>
Sun, 29 Mar 2020 22:54:08 +0000 (01:54 +0300)
committerOleg Broytman <phd@phdru.name>
Sun, 29 Mar 2020 22:54:08 +0000 (01:54 +0300)
64 files changed:
playbooks/debian/add-apache-vhost
playbooks/debian/add-dns-domain
playbooks/debian/init-system.sh
playbooks/debian/roles/add-apache-vhost/meta/main.yml [deleted file]
playbooks/debian/roles/add-dns-domain/meta/main.yml [deleted file]
playbooks/debian/roles/apache/meta/main.yml [deleted file]
playbooks/debian/roles/dehydrated/meta/main.yml [deleted file]
playbooks/debian/roles/named/meta/main.yml [deleted file]
playbooks/init-system2.yml
playbooks/redhat/init-system.sh
playbooks/roles/debian/add-apache-vhost/README.txt [moved from playbooks/debian/roles/add-apache-vhost/README.txt with 100% similarity]
playbooks/roles/debian/add-apache-vhost/files/dehydrated [moved from playbooks/debian/roles/add-apache-vhost/files/dehydrated with 100% similarity]
playbooks/roles/debian/add-apache-vhost/handlers/main.yml [moved from playbooks/debian/roles/add-apache-vhost/handlers/main.yml with 100% similarity]
playbooks/roles/debian/add-apache-vhost/meta/main.yml [new file with mode: 0644]
playbooks/roles/debian/add-apache-vhost/tasks/add-vhost.yml [moved from playbooks/debian/roles/add-apache-vhost/tasks/add-vhost.yml with 100% similarity]
playbooks/roles/debian/add-apache-vhost/tasks/dehydrated.yml [moved from playbooks/debian/roles/add-apache-vhost/tasks/dehydrated.yml with 100% similarity]
playbooks/roles/debian/add-apache-vhost/tasks/main.yml [moved from playbooks/debian/roles/add-apache-vhost/tasks/main.yml with 100% similarity]
playbooks/roles/debian/add-apache-vhost/templates/dehydrated/config [moved from playbooks/debian/roles/add-apache-vhost/templates/dehydrated/config with 100% similarity]
playbooks/roles/debian/add-apache-vhost/templates/dehydrated/domains.txt [moved from playbooks/debian/roles/add-apache-vhost/templates/dehydrated/domains.txt with 100% similarity]
playbooks/roles/debian/add-apache-vhost/templates/vhost.conf [moved from playbooks/debian/roles/add-apache-vhost/templates/vhost.conf with 100% similarity]
playbooks/roles/debian/add-dns-domain/README.txt [moved from playbooks/debian/roles/add-dns-domain/README.txt with 100% similarity]
playbooks/roles/debian/add-dns-domain/meta/main.yml [new file with mode: 0644]
playbooks/roles/debian/add-dns-domain/tasks/main.yml [moved from playbooks/debian/roles/add-dns-domain/tasks/main.yml with 100% similarity]
playbooks/roles/debian/add-dns-domain/templates/domain [moved from playbooks/debian/roles/add-dns-domain/templates/domain with 100% similarity]
playbooks/roles/debian/apache/README.txt [moved from playbooks/debian/roles/apache/README.txt with 100% similarity]
playbooks/roles/debian/apache/files/_default_/favicon.ico [moved from playbooks/debian/roles/apache/files/_default_/favicon.ico with 100% similarity]
playbooks/roles/debian/apache/files/_default_/index.html [moved from playbooks/debian/roles/apache/files/_default_/index.html with 100% similarity]
playbooks/roles/debian/apache/files/_default_/nothing.html [moved from playbooks/debian/roles/apache/files/_default_/nothing.html with 100% similarity]
playbooks/roles/debian/apache/files/_default_/robots.txt [moved from playbooks/debian/roles/apache/files/_default_/robots.txt with 100% similarity]
playbooks/roles/debian/apache/files/apache2 [moved from playbooks/debian/roles/apache/files/apache2 with 100% similarity]
playbooks/roles/debian/apache/handlers/main.yml [moved from playbooks/debian/roles/apache/handlers/main.yml with 100% similarity]
playbooks/roles/debian/apache/meta/main.yml [new file with mode: 0644]
playbooks/roles/debian/apache/tasks/main.yml [moved from playbooks/debian/roles/apache/tasks/main.yml with 100% similarity]
playbooks/roles/debian/apache/templates/001-phd.conf [moved from playbooks/debian/roles/apache/templates/001-phd.conf with 100% similarity]
playbooks/roles/debian/dehydrated/README.txt [moved from playbooks/debian/roles/dehydrated/README.txt with 100% similarity]
playbooks/roles/debian/dehydrated/files/dehydrated [moved from playbooks/debian/roles/dehydrated/files/dehydrated with 100% similarity]
playbooks/roles/debian/dehydrated/meta/main.yml [new file with mode: 0644]
playbooks/roles/debian/dehydrated/tasks/main.yml [moved from playbooks/debian/roles/dehydrated/tasks/main.yml with 100% similarity]
playbooks/roles/debian/firewall/README.txt [moved from playbooks/debian/roles/firewall/README.txt with 100% similarity]
playbooks/roles/debian/firewall/files/etc/init.d/iptables.sh [moved from playbooks/debian/roles/firewall/files/etc/init.d/iptables.sh with 100% similarity]
playbooks/roles/debian/firewall/files/etc/init.d/rc.masq [moved from playbooks/debian/roles/firewall/files/etc/init.d/rc.masq with 100% similarity]
playbooks/roles/debian/firewall/files/etc/network/functions.phd [moved from playbooks/debian/roles/firewall/files/etc/network/functions.phd with 100% similarity]
playbooks/roles/debian/firewall/files/etc/network/if-down.d/eth [moved from playbooks/debian/roles/firewall/files/etc/network/if-down.d/eth with 100% similarity]
playbooks/roles/debian/firewall/files/etc/network/if-up.d/eth [moved from playbooks/debian/roles/firewall/files/etc/network/if-up.d/eth with 100% similarity]
playbooks/roles/debian/firewall/handlers/main.yml [moved from playbooks/debian/roles/firewall/handlers/main.yml with 100% similarity]
playbooks/roles/debian/firewall/tasks/main.yml [moved from playbooks/debian/roles/firewall/tasks/main.yml with 100% similarity]
playbooks/roles/debian/init-logcheck/README.txt [moved from playbooks/debian/roles/init-logcheck/README.txt with 100% similarity]
playbooks/roles/debian/init-logcheck/tasks/main.yml [moved from playbooks/debian/roles/init-logcheck/tasks/main.yml with 100% similarity]
playbooks/roles/debian/named/README.txt [moved from playbooks/debian/roles/named/README.txt with 100% similarity]
playbooks/roles/debian/named/files/named.conf.options [moved from playbooks/debian/roles/named/files/named.conf.options with 100% similarity]
playbooks/roles/debian/named/meta/main.yml [new file with mode: 0644]
playbooks/roles/debian/named/tasks/main.yml [moved from playbooks/debian/roles/named/tasks/main.yml with 100% similarity]
playbooks/roles/debian/remove-systemd/README.txt [moved from playbooks/debian/roles/remove-systemd/README.txt with 100% similarity]
playbooks/roles/debian/remove-systemd/files/etc/apt/preferences.d/no-systemd [moved from playbooks/debian/roles/remove-systemd/files/etc/apt/preferences.d/no-systemd with 100% similarity]
playbooks/roles/debian/remove-systemd/tasks/main.yml [moved from playbooks/debian/roles/remove-systemd/tasks/main.yml with 100% similarity]
playbooks/roles/debian/remove-systemd/tasks/remove-systemd.yml [moved from playbooks/debian/roles/remove-systemd/tasks/remove-systemd.yml with 100% similarity]
playbooks/roles/redhat/firewall/README.txt [moved from playbooks/redhat/roles/firewall/README.txt with 100% similarity]
playbooks/roles/redhat/firewall/files/etc/network/functions.phd [moved from playbooks/redhat/roles/firewall/files/etc/network/functions.phd with 100% similarity]
playbooks/roles/redhat/firewall/files/etc/network/if-down.d/eth [moved from playbooks/redhat/roles/firewall/files/etc/network/if-down.d/eth with 100% similarity]
playbooks/roles/redhat/firewall/files/etc/network/if-up.d/eth [moved from playbooks/redhat/roles/firewall/files/etc/network/if-up.d/eth with 100% similarity]
playbooks/roles/redhat/firewall/files/etc/rc.d/init.d/iptables.sh [moved from playbooks/redhat/roles/firewall/files/etc/rc.d/init.d/iptables.sh with 100% similarity]
playbooks/roles/redhat/firewall/files/etc/rc.d/init.d/rc.masq [moved from playbooks/redhat/roles/firewall/files/etc/rc.d/init.d/rc.masq with 100% similarity]
playbooks/roles/redhat/firewall/handlers/main.yml [moved from playbooks/redhat/roles/firewall/handlers/main.yml with 100% similarity]
playbooks/roles/redhat/firewall/tasks/main.yml [moved from playbooks/redhat/roles/firewall/tasks/main.yml with 100% similarity]

index 750f3fcb915b7d044d0217dd833089abc724e1ea..41c866c07d94938262f69d1c569541f1c6d2f6be 100755 (executable)
@@ -9,6 +9,5 @@ vhost="$1"
 shift
 
 cd "`dirname \"$0\"`" &&
-ANSIBLE_ROLES_PATH=debian/roles:roles \
-   exec ../run-roles add-apache-vhost "$@" \
-      -e virtual_host="$vhost" -e gather_facts=true
+exec ../run-roles add-apache-vhost "$@" \
+   -e virtual_host="$vhost" -e gather_facts=true
index f4d2f4a550dc90228f9ff0dadbb86e98bb7077ba..c62fd738e8fc50c4fed97850d492550ba663e72a 100755 (executable)
@@ -9,6 +9,5 @@ domain="$1"
 shift
 
 cd "`dirname \"$0\"`" &&
-ANSIBLE_ROLES_PATH=debian/roles:roles \
-   exec ../run-roles add-dns-domain "$@" \
-      -e domain="$domain" -e gather_facts=true
+exec ../run-roles add-dns-domain "$@" \
+   -e domain="$domain" -e gather_facts=true
index e72f3182ce15e61fdd4e8695e25391cddee6de79..2937b319fb760ffd5fede030386a048d20652a16 100755 (executable)
@@ -9,12 +9,10 @@ host="$1"
 shift
 
 cd "`dirname \"$0\"`" &&
-ANSIBLE_ROLES_PATH=roles:../roles &&
-export ANSIBLE_ROLES_PATH &&
 
 # Passwordless access isn't configured yet; use `ssh` connection sharing.
 # `sudo` isn't configured yet too; use `su` and ask for root password.
 ansible-playbook ../init-system.yml "$@" -e hosts="$host" \
    --become-method=su -K &&
-ANSIBLE_ROLES_PATH=debian/roles ../run-roles remove-systemd "$@" -e hosts="$host" &&
+../run-roles remove-systemd "$@" -e hosts="$host" &&
 exec ansible-playbook ../init-system2.yml "$@" -e hosts="$host"
diff --git a/playbooks/debian/roles/add-apache-vhost/meta/main.yml b/playbooks/debian/roles/add-apache-vhost/meta/main.yml
deleted file mode 100644 (file)
index 0a640ed..0000000
+++ /dev/null
@@ -1 +0,0 @@
-dependencies: ['apache', 'dehydrated']
diff --git a/playbooks/debian/roles/add-dns-domain/meta/main.yml b/playbooks/debian/roles/add-dns-domain/meta/main.yml
deleted file mode 100644 (file)
index 6c17612..0000000
+++ /dev/null
@@ -1 +0,0 @@
-dependencies: ['named']
diff --git a/playbooks/debian/roles/apache/meta/main.yml b/playbooks/debian/roles/apache/meta/main.yml
deleted file mode 100644 (file)
index 1d59f7a..0000000
+++ /dev/null
@@ -1 +0,0 @@
-dependencies: ['init-system', 'firewall', 'init-logcheck']
diff --git a/playbooks/debian/roles/dehydrated/meta/main.yml b/playbooks/debian/roles/dehydrated/meta/main.yml
deleted file mode 100644 (file)
index c84c3cf..0000000
+++ /dev/null
@@ -1 +0,0 @@
-dependencies: ['apache']
diff --git a/playbooks/debian/roles/named/meta/main.yml b/playbooks/debian/roles/named/meta/main.yml
deleted file mode 100644 (file)
index 1d59f7a..0000000
+++ /dev/null
@@ -1 +0,0 @@
-dependencies: ['init-system', 'firewall', 'init-logcheck']
index 947fd6609ef574cca5d2923bf149ed9783e86f88..e4449ebda85eebe9f1ceb6f700b66a455e2ec3ee 100644 (file)
@@ -2,7 +2,10 @@
   hosts: "{{ hosts | default('all') }}"
   gather_facts: true
   roles:
-    - firewall
+    - debian/firewall
+      when: ansible_facts.os_family == 'Debian'
+    - redhat/firewall
+      when: ansible_facts.os_family == 'RedHat'
     - logcheck
     - root
     - setup-usrlocal
index 92361652468f18cfde661ee86fc487298e688f42..df2f22f5d4386d230c7db20eac36d15be3d0de08 100755 (executable)
@@ -9,8 +9,6 @@ host="$1"
 shift
 
 cd "`dirname \"$0\"`" &&
-ANSIBLE_ROLES_PATH=roles:../roles &&
-export ANSIBLE_ROLES_PATH &&
 
 # Passwordless access isn't configured yet; use `ssh` connection sharing.
 # `sudo` isn't configured yet too; ask for phd password.
diff --git a/playbooks/roles/debian/add-apache-vhost/meta/main.yml b/playbooks/roles/debian/add-apache-vhost/meta/main.yml
new file mode 100644 (file)
index 0000000..ab0f395
--- /dev/null
@@ -0,0 +1 @@
+dependencies: ['debian/apache', 'debian/dehydrated']
diff --git a/playbooks/roles/debian/add-dns-domain/meta/main.yml b/playbooks/roles/debian/add-dns-domain/meta/main.yml
new file mode 100644 (file)
index 0000000..7b39c7e
--- /dev/null
@@ -0,0 +1 @@
+dependencies: ['debian/named']
diff --git a/playbooks/roles/debian/apache/meta/main.yml b/playbooks/roles/debian/apache/meta/main.yml
new file mode 100644 (file)
index 0000000..bf5afc7
--- /dev/null
@@ -0,0 +1 @@
+dependencies: ['init-system', 'debian/firewall', 'debian/init-logcheck']
diff --git a/playbooks/roles/debian/dehydrated/meta/main.yml b/playbooks/roles/debian/dehydrated/meta/main.yml
new file mode 100644 (file)
index 0000000..eed76b7
--- /dev/null
@@ -0,0 +1 @@
+dependencies: ['debian/apache']
diff --git a/playbooks/roles/debian/named/meta/main.yml b/playbooks/roles/debian/named/meta/main.yml
new file mode 100644 (file)
index 0000000..bf5afc7
--- /dev/null
@@ -0,0 +1 @@
+dependencies: ['init-system', 'debian/firewall', 'debian/init-logcheck']