zen_rev_proxy/tasks/main.yml
Chris Hammer 3b5a8e2c54 0.1.15-DEV-20191117-205920
--------------------------
    * ADD:
      - add tags to each task
      - added clean deploy task for site removals; will only run if task tag is used
      - added tower2.thezengarden.net to site list for testing awx installs/upgrades

    * MODIFY:
      - modified awx site reference to be tower
2019-11-17 21:01:11 -05:00

73 lines
1.3 KiB
YAML

---
# tasks file for zen_rev_proxy
- name: alter package list for centos
set_fact:
proxy_package_list: ['nginx','git']
tags: always
when: ansible_distribution == "CentOS"
- name: install proxy packages
package:
name : "{{ proxy_package_list }}"
state : present
tags: always
- name: enable nginx at boot time
service:
name : nginx
enabled : yes
tags: always
when: ansible_virtualization_type != "docker"
- name: clean conf.d
file:
path: "{{ proxy_site_conf_dir }}"
state: absent
tags: ['clean_deploy','never']
- name: create conf.d directory
file:
path : "{{ proxy_site_conf_dir }}"
state : directory
mode : 0755
tags: always
- name: create log directory
file:
path : "{{ proxy_site_log_path }}"
state : directory
mode : 0755
tags: always
- name: clone ssl certs
git:
repo: "{{ ssl_repo }}"
dest: "{{ proxy_site_ssl_directory }}"
version: "{{ ssl_repo_branch }}"
tags: always
notify: restart nginx
- name: write configuration file(s)
template:
src : proxy_site.j2
dest : "{{ proxy_site_conf_dir }}/{{ item.key }}.conf"
mode : 0644
with_dict:
- "{{ proxy_sites }}"
tags: always
notify: restart nginx
- name: start nginx
service:
name : nginx
state : started
tags: always
when: ansible_virtualization_type != "docker"