Browse Source

Add nginx_file_nginx_config variable

We'll use this to install nginx configuration on the remote node.

Change-Id: Ib7894547392220da72c37c2be407fd235c6df72f
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
changes/49/648849/5
Paul Belanger 3 years ago
parent
commit
b785da4823
  1. 12
      defaults/main.yaml
  2. 8
      handlers/main.yaml
  3. 28
      tasks/config.yaml

12
defaults/main.yaml

@ -18,14 +18,10 @@ nginx_task_manager:
- config
- service
nginx_file_include_dir_dest: /etc/nginx/conf.d/
nginx_file_include_dir_group: root
nginx_file_include_dir_mode: 0755
nginx_file_include_dir_owner: root
nginx_file_include_dir_src: ""
nginx_file_nginx_conf_dest: /etc/nginx/nginx.conf
nginx_file_nginx_conf_src: ""
nginx_file_nginx_config_group: root
nginx_file_nginx_config_mode: 0644
nginx_file_nginx_config_owner: root
nginx_file_nginx_config: []
nginx_package_name: nginx

8
handlers/main.yaml

@ -12,3 +12,11 @@
# License for the specific language governing permissions and limitations
# under the License.
---
- name: Reload nginx
become: true
service:
name: nginx
state: reloaded
when: nginx_service_nginx_manage and
nginx_service_nginx_state == "started" and not
nginx_service_nginx.changed

28
tasks/config.yaml

@ -12,23 +12,13 @@
# License for the specific language governing permissions and limitations
# under the License.
---
- name: Copy nginx configuration file
- name: Install nginx configuration files
become: true
copy:
dest: "{{ nginx_file_nginx_conf_dest }}"
src: "{{ nginx_file_nginx_conf_src }}"
when: nginx_file_nginx_conf_src
notify:
- Restart nginx
- name: Copy nginx custom configuration
become: true
copy:
dest: "{{ nginx_file_include_dir_dest }}"
group: "{{ nginx_file_include_dir_group }}"
mode: "{{ nginx_file_include_dir_mode }}"
owner: "{{ nginx_file_include_dir_owner }}"
src: "{{ nginx_file_include_dir_src }}"
when: nginx_file_include_dir_src
notify:
- Restart nginx
template:
dest: "{{ item.dest }}"
group: "{{ nginx_file_nginx_config_group }}"
mode: "{{ nginx_file_nginx_config_mode }}"
owner: "{{ nginx_file_nginx_config_owner }}"
src: "{{ item.src }}"
notify: Reload nginx
with_items: "{{ nginx_file_nginx_config }}"

Loading…
Cancel
Save