diff options
| author | Mitch Riedstra <mitch@riedstra.us> | 2020-05-22 23:58:32 -0400 |
|---|---|---|
| committer | Mitch Riedstra <mitch@riedstra.us> | 2020-05-22 23:58:32 -0400 |
| commit | 3ca81c0d25ff302ac86ce1c178ea710eb7ba7074 (patch) | |
| tree | c038a90838962f6aff8eae35087348bb0e2f850d /tasks/main.yml | |
| parent | e01f450ec79c8fe736d5a0ea7edb2812fcc1fc96 (diff) | |
| download | nginx-3ca81c0d25ff302ac86ce1c178ea710eb7ba7074.tar.gz nginx-3ca81c0d25ff302ac86ce1c178ea710eb7ba7074.tar.xz | |
Add in robots configuration
Diffstat (limited to 'tasks/main.yml')
| -rw-r--r-- | tasks/main.yml | 32 |
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}}' |
