aboutsummaryrefslogtreecommitdiff
path: root/tasks
diff options
context:
space:
mode:
Diffstat (limited to 'tasks')
-rw-r--r--tasks/main.yml32
1 files changed, 31 insertions, 1 deletions
diff --git a/tasks/main.yml b/tasks/main.yml
index 7629c87..9c8c4b1 100644
--- a/tasks/main.yml
+++ b/tasks/main.yml
@@ -23,6 +23,36 @@
owner: "{{nginx_conf_owner}}"
group: "{{nginx_conf_group}}"
mode: "0755"
+- name: Create Robots directory
+ file:
+ path: /var/lib/nginx-robots
+ state: directory
+ owner: "{{nginx_conf_owner}}"
+ group: "{{nginx_conf_group}}"
+ mode: "0755"
+- name: Create Robots sub directory
+ file:
+ path: '/var/lib/nginx-robots/{{item.name}}'
+ state: directory
+ owner: "{{nginx_conf_owner}}"
+ group: "{{nginx_conf_group}}"
+ mode: "0755"
+ loop: '{{nginx_robots}}'
+- name: 'Install {{item.name}} robots'
+ copy:
+ dest: '/var/lib/nginx-robots/{{item.name}}/robots.txt'
+ content: '{{item.robots_txt}}'
+ owner: '{{nginx_conf_owner}}'
+ loop: '{{nginx_robots}}'
+- name: Install Robots includes
+ copy:
+ dest: "{{nginx_conf_dir}}/robots_{{item.name}}"
+ content: |
+ location /robots.txt {
+ root /var/lib/nginx-robots/{{item.name}};
+ }
+ owner: '{{nginx_conf_owner}}'
+ loop: '{{nginx_robots}}'
- name: Install Main 'nginx.conf'
template:
src: nginx/nginx.conf
@@ -54,7 +84,7 @@
- acme-challenge
- acl
notify:
- - Restart Nginx
+ - Restart Nginx
- name: Install Htpasswd
copy:
src: '{{nginx_htpasswd}}'