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>
This commit is contained in:
Paul Belanger 2019-03-30 23:32:11 -04:00
parent 65afd10447
commit b785da4823
3 changed files with 21 additions and 27 deletions

View File

@ -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

View File

@ -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

View File

@ -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 }}"