Skip to content
This repository has been archived by the owner on Jan 30, 2024. It is now read-only.

Commit

Permalink
Create directory for Pulp Nginx snippets
Browse files Browse the repository at this point in the history
  • Loading branch information
fao89 committed Apr 29, 2020
1 parent ae8f6bf commit c2b5fad
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGES/6594.feature
@@ -0,0 +1 @@
Created a directory for Pulp nginx snippets
22 changes: 21 additions & 1 deletion roles/pulp-webserver/tasks/nginx.yml
Expand Up @@ -32,6 +32,26 @@
dest: /etc/nginx/nginx.conf
notify: reload nginx

- name: Find pulp obsolete symlinks
find:
paths: /etc/nginx/conf.d
file_type: link
patterns: "pulp*"
register: old_pulp_symlinks
tags: cleanup

- name: Remove pulp obsolete symlinks
file:
path: "{{ item.path }}"
state: absent
with_items: "{{ old_pulp_symlinks.files }}"
tags: cleanup

- name: Create directory for Pulp Nginx snippets
file:
path: "/etc/nginx/pulp/"
state: directory

- name: Check installed plugins for nginx snippets
script:
cmd: check_snippet.py {{ item.key | regex_replace("-", "_") | quote }} nginx.conf
Expand All @@ -50,7 +70,7 @@
file:
src: "{{ item.stdout_lines | last }}"
# Note: item.item is pulp_install_plugins
dest: "/etc/nginx/conf.d/{{ item.item.key | regex_replace('-', '_') }}.conf"
dest: "/etc/nginx/pulp/{{ item.item.key | regex_replace('-', '_') }}.conf"
state: link
loop: '{{ snippets.results }}'
when: item.rc == 0
Expand Down
2 changes: 1 addition & 1 deletion roles/pulp-webserver/templates/nginx.conf.j2
Expand Up @@ -75,7 +75,7 @@ http {
proxy_pass http://pulp-api;
}

include conf.d/*.conf;
include pulp/*.conf;

location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
Expand Down

0 comments on commit c2b5fad

Please sign in to comment.