Merge "Remove legacy nginx cleanup tasks"
This commit is contained in:
commit
419cb210a9
@ -47,46 +47,6 @@
|
||||
- ansible_facts['pkg_mgr'] == 'dnf'
|
||||
- keystone_sp != {}
|
||||
|
||||
# TODO(noonedeadpunk): Remove nginx-related changes in Y release
|
||||
- name: Remove nginx keystone vhost configuration
|
||||
file:
|
||||
path: "/etc/nginx/{{ (ansible_facts['os_family'] | lower == 'debian') | ternary('sites-available', 'conf.d') }}/{{ item }}.conf"
|
||||
state: absent
|
||||
with_items: "{{ keystone_services.keys() | list }}"
|
||||
register: nginx_vhosts
|
||||
|
||||
- name: Remove nginx symlink for vhost configuration
|
||||
file:
|
||||
path: /etc/nginx/sites-enabled/{{ item }}.conf
|
||||
state: absent
|
||||
with_items: "{{ keystone_services.keys() | list }}"
|
||||
when: ansible_facts['os_family'] == "Debian"
|
||||
|
||||
- name: Reload nginx if needed
|
||||
service:
|
||||
name: "nginx"
|
||||
state: restarted
|
||||
failed_when: false
|
||||
when: nginx_vhosts is changed
|
||||
|
||||
# If the web server being removed was never installed, this task will fail when trying
|
||||
# to stop/disable it. The task is therefore set to never fail.
|
||||
- name: Remove nginx web server
|
||||
when: "('repo_all' in groups and inventory_hostname not in groups['repo_all']) or ('repo_all' not in groups)"
|
||||
block:
|
||||
- name: Ensure nginx web server is not running/enabled
|
||||
service:
|
||||
name: "nginx"
|
||||
enabled: no
|
||||
state: stopped
|
||||
failed_when: false
|
||||
|
||||
- name: Remove nginx server distro packages
|
||||
package:
|
||||
name: "nginx"
|
||||
state: absent
|
||||
autoremove: "{{ (ansible_facts['pkg_mgr'] == 'apt') | ternary('yes', omit) }}"
|
||||
|
||||
- name: Install distro packages
|
||||
package:
|
||||
name: "{{ keystone_package_list }}"
|
||||
|
Loading…
Reference in New Issue
Block a user