From 7e4f94b741017d0bde3c0308fb431e0dbaad17da Mon Sep 17 00:00:00 2001 From: Paul Belanger Date: Thu, 3 Mar 2016 10:13:49 -0500 Subject: [PATCH] Drop synchronize support It was become too much work to deal with this. Additionally, if people want to manually synchronize we expose the proper settings to allow them to do so. Change-Id: I8134f93cf89625712187487ef04739d43b6db1b7 Signed-off-by: Paul Belanger --- defaults/main.yaml | 8 ++++---- tasks/config.yaml | 13 ++----------- tests/test.yaml | 15 +++++++++++++++ 3 files changed, 21 insertions(+), 15 deletions(-) diff --git a/defaults/main.yaml b/defaults/main.yaml index ca4064b..0fc1faf 100644 --- a/defaults/main.yaml +++ b/defaults/main.yaml @@ -12,10 +12,10 @@ # License for the specific language governing permissions and limitations # under the License. --- -nginx_file_include_dir_dest: /etc/nginx/conf.d -nginx_file_include_dir_group: "{{ ansible_user }}" -nginx_file_include_dir_mode: "0755" -nginx_file_include_dir_owner: "{{ ansible_user }}" +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 diff --git a/tasks/config.yaml b/tasks/config.yaml index aa7b70e..6884a79 100644 --- a/tasks/config.yaml +++ b/tasks/config.yaml @@ -21,21 +21,12 @@ - Validate nginx - Restart nginx -- name: Create custom configuration directory. - become: yes - file: +- name: Copy nginx custom configuration. + 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 }}" - state: directory - -- name: Rsync nginx configuration. - become: no - synchronize: - delete: yes - dest: "{{ nginx_file_include_dir_dest }}" - perms: yes src: "{{ nginx_file_include_dir_src }}" when: nginx_file_include_dir_src != "" notify: diff --git a/tests/test.yaml b/tests/test.yaml index 62d6636..9060b35 100644 --- a/tests/test.yaml +++ b/tests/test.yaml @@ -25,3 +25,18 @@ roles: - "{{ rolename }}" + + post_tasks: + - name: Register /etc/nginx/conf.d + stat: + path: /etc/nginx/conf.d + register: nginx_confd_stat + + - name: Assert nginx_confd_stat tests. + assert: + that: + - nginx_confd_stat.stat.exists + - nginx_confd_stat.stat.isdir + - nginx_confd_stat.stat.pw_name == 'root' + - nginx_confd_stat.stat.gr_name == 'root' + - nginx_confd_stat.stat.mode == '0755'