From c3bdb3c7e51b1476af9ebf090fac2fbe323c1091 Mon Sep 17 00:00:00 2001 From: binary Date: Thu, 14 Jan 2021 18:57:53 +0100 Subject: Breakdown roles links with dependencies --- playbooks/vm2.rgoncalves.se.yml | 3 ++- roles/cgit/meta/main.yml | 7 +++++++ roles/cgit/tasks/main.yml | 20 +++++--------------- roles/httpd/meta/main.yml | 8 ++++++++ roles/httpd/tasks/main.yml | 12 ++---------- roles/httpd_pre/tasks/main.yml | 15 +++++++++++++++ roles/stagit/meta/main.yml | 7 +++++++ 7 files changed, 46 insertions(+), 26 deletions(-) create mode 100644 roles/cgit/meta/main.yml create mode 100644 roles/httpd/meta/main.yml create mode 100644 roles/httpd_pre/tasks/main.yml create mode 100644 roles/stagit/meta/main.yml diff --git a/playbooks/vm2.rgoncalves.se.yml b/playbooks/vm2.rgoncalves.se.yml index dacb4a4..c7136f9 100644 --- a/playbooks/vm2.rgoncalves.se.yml +++ b/playbooks/vm2.rgoncalves.se.yml @@ -8,7 +8,8 @@ - hosts: vm2 roles: - - { role: git } + - { role: httpd_pre } - { role: stagit } + - { role: cgit } - { role: httpd } #- { role: grafana } diff --git a/roles/cgit/meta/main.yml b/roles/cgit/meta/main.yml new file mode 100644 index 0000000..121b592 --- /dev/null +++ b/roles/cgit/meta/main.yml @@ -0,0 +1,7 @@ + +# cgit ~~ roles/cgit/meta/main.yml +# Meta parameters + +--- + +dependencies: git diff --git a/roles/cgit/tasks/main.yml b/roles/cgit/tasks/main.yml index c5b2420..3a20a59 100644 --- a/roles/cgit/tasks/main.yml +++ b/roles/cgit/tasks/main.yml @@ -9,18 +9,8 @@ name: cgit state: present -- name: ensure httpd.d directory exists - file: path=/etc/httpd.d state=directory - -- name: copy httpd configuration - copy: - src: httpd.conf - dest: /etc/httpd.d/stagit.conf - owner: "{{ user_root }}" - group: "{{ group_root }}" - mode: 0644 - -- name: execute static-page generation script once - shell: ./generate-static-git.sh - args: - chdir: "{{ stagit_htmldir }}" +- name: start and enable slowcgi service + service: + name: slowcgi + state: restarted + enabled: true diff --git a/roles/httpd/meta/main.yml b/roles/httpd/meta/main.yml new file mode 100644 index 0000000..97eaea7 --- /dev/null +++ b/roles/httpd/meta/main.yml @@ -0,0 +1,8 @@ + +# httpd ~~ roles/httpd/meta/main.yml +# Meta for httpd + +--- + +dependencies: + - role: http_pre diff --git a/roles/httpd/tasks/main.yml b/roles/httpd/tasks/main.yml index 4abf95a..6c91aac 100644 --- a/roles/httpd/tasks/main.yml +++ b/roles/httpd/tasks/main.yml @@ -1,17 +1,9 @@ -# dns ~~ roles/dns/tasks/main.yml -# ensure host is using unified dns +# httpd ~~ roles/httpd/tasks/main.yml +# OpenBSD httpd --- -- name: ensure httpd.d directory exists - file: - path: /etc/httpd.d - state: directory - owner: "{{ user_root }}" - group: "{{ group_root }}" - mode: 0644 - - name: retrieve all configuration files find: path: /etc/httpd.d diff --git a/roles/httpd_pre/tasks/main.yml b/roles/httpd_pre/tasks/main.yml new file mode 100644 index 0000000..61b052a --- /dev/null +++ b/roles/httpd_pre/tasks/main.yml @@ -0,0 +1,15 @@ + +# httpd ~~ roles/httpd_pre/main.yml +# prerequisites for `httpd` role + +--- + +- name: ensure httpd.d directory exists + file: + path: /etc/httpd.d + state: directory + owner: "{{ user_root }}" + group: "{{ group_root }}" + mode: 0644 + + diff --git a/roles/stagit/meta/main.yml b/roles/stagit/meta/main.yml new file mode 100644 index 0000000..db410a7 --- /dev/null +++ b/roles/stagit/meta/main.yml @@ -0,0 +1,7 @@ + +# stagit ~~ roles/stagit/meta/main.yml +# Meta parameters + +--- + +dependencies: git -- cgit v1.2.3