aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRomain Gonçalves <me@rgoncalves.se>2021-12-11 13:53:42 +0000
committerRomain Gonçalves <me@rgoncalves.se>2021-12-11 13:53:42 +0000
commit48208c520bb15d16b0eab623b97fa5e86c6f665c (patch)
tree04426637268385dbdd230ed61b9b1dd86c5de542
parentc1e3bbbe04863536e88d4d79afbbb85253e7d3b4 (diff)
downloadinfrastructure-48208c520bb15d16b0eab623b97fa5e86c6f665c.tar.gz
roles/httpd_pre: Switch for NFS and common defaults
-rw-r--r--group_vars/all.yml1
-rw-r--r--host_vars/dc0.yml2
-rw-r--r--roles/httpd/defaults/main.yml1
l---------roles/httpd_pre/defaults/main.yml1
-rw-r--r--roles/httpd_pre/tasks/main.yml10
5 files changed, 11 insertions, 4 deletions
diff --git a/group_vars/all.yml b/group_vars/all.yml
index 72bf8d6..77af34b 100644
--- a/group_vars/all.yml
+++ b/group_vars/all.yml
@@ -3,6 +3,7 @@ ansible_become_method: su
wireguard_domain_controller: "{{ __global_domain_controller }}"
nfsclient_server: "stack0"
+httpd_use_nfs: true
__is_vm: false
diff --git a/host_vars/dc0.yml b/host_vars/dc0.yml
index f517188..d145b81 100644
--- a/host_vars/dc0.yml
+++ b/host_vars/dc0.yml
@@ -1,3 +1,5 @@
+httpd_use_nfs: false
+
__is_vm: true
__ip:
diff --git a/roles/httpd/defaults/main.yml b/roles/httpd/defaults/main.yml
index 9ccd2f3..e09e3cd 100644
--- a/roles/httpd/defaults/main.yml
+++ b/roles/httpd/defaults/main.yml
@@ -1,4 +1,3 @@
httpd_configuration_file: /etc/httpd.conf
httpd_configuration_dir: /etc/httpd.d
httpd_chroot: /var/www
-httpd_use_nfs: false
diff --git a/roles/httpd_pre/defaults/main.yml b/roles/httpd_pre/defaults/main.yml
new file mode 120000
index 0000000..52d65d9
--- /dev/null
+++ b/roles/httpd_pre/defaults/main.yml
@@ -0,0 +1 @@
+../../httpd/defaults/main.yml \ No newline at end of file
diff --git a/roles/httpd_pre/tasks/main.yml b/roles/httpd_pre/tasks/main.yml
index 83afb91..0209a84 100644
--- a/roles/httpd_pre/tasks/main.yml
+++ b/roles/httpd_pre/tasks/main.yml
@@ -1,6 +1,3 @@
-- name: include httpd role variables
- include_vars: "{{ inventory_dir }}/roles/httpd/defaults/main.yml"
-
- name: create httpd directory
file:
path: /etc/httpd.d
@@ -16,3 +13,10 @@
owner: "www"
group: "www"
mode: 0700
+
+- name: mount nfs in chroot
+ include_role:
+ name: nfsclient
+ vars:
+ nfsclient_dir: "{{ httpd_chroot }}/data"
+ when: httpd_use_nfs
remember that computers suck.