Removing unneeded with_items usage

Add clarity to the role's function by
removing usages of with_items where only a
single item is present.

Change-Id: Ic057e1fff4ae4f5969662230feb14561752b8d22
This commit is contained in:
Travis Truman 2016-03-29 10:55:31 -04:00
parent 592eab69a8
commit 72a3b5da89
4 changed files with 27 additions and 46 deletions

View File

@ -15,13 +15,11 @@
- name: Add zaqar apache WSGI script
template:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
src: "zaqar-wsgi.py.j2"
dest: "/var/www/cgi-bin/zaqar/app"
owner: "{{ zaqar_system_user_name }}"
group: "{{ zaqar_system_group_name }}"
mode: "{{ item.mode|default('0644') }}"
with_items:
- { src: "zaqar-wsgi.py.j2", dest: "/var/www/cgi-bin/zaqar/app", mode: "0755" }
mode: "0755"
notify:
- Restart Apache
tags:
@ -29,12 +27,10 @@
- name: Add zaqar apache configuration file
template:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
src: "zaqar-httpd.conf.j2"
dest: "/etc/apache2/sites-available/zaqar-httpd.conf"
owner: "root"
group: "root"
with_items:
- { src: "zaqar-httpd.conf.j2", dest: "/etc/apache2/sites-available/zaqar-httpd.conf" }
notify:
- Restart Apache
tags:
@ -51,11 +47,9 @@
- name: Enabled zaqar vhost
file:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
state: "{{ item.state }}"
with_items:
- { src: "/etc/apache2/sites-available/zaqar-httpd.conf", dest: "/etc/apache2/sites-enabled/zaqar-httpd.conf", state: "link" }
src: "/etc/apache2/sites-available/zaqar-httpd.conf"
dest: "/etc/apache2/sites-enabled/zaqar-httpd.conf"
state: "link"
notify:
- Restart Apache
tags:

View File

@ -15,13 +15,11 @@
- name: Add zaqar nginx WSGI script
template:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
src: "zaqar-wsgi.py.j2"
dest: "/var/www/cgi-bin/zaqar/app.py"
owner: "{{ zaqar_system_user_name }}"
group: "{{ zaqar_system_group_name }}"
mode: "{{ item.mode|default('0644') }}"
with_items:
- { src: "zaqar-wsgi.py.j2", dest: "/var/www/cgi-bin/zaqar/app.py", mode: "0755" }
mode: "0755"
notify:
- Restart Nginx
tags:
@ -45,12 +43,10 @@
- name: Add zaqar nginx configuration file
template:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
src: "zaqar-nginx.conf.j2"
dest: "/etc/nginx/sites-available/zaqar-nginx.conf"
owner: "root"
group: "root"
with_items:
- { src: "zaqar-nginx.conf.j2", dest: "/etc/nginx/sites-available/zaqar-nginx.conf" }
notify:
- Restart Nginx
tags:
@ -58,11 +54,9 @@
- name: Enabled zaqar vhost
file:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
state: "{{ item.state }}"
with_items:
- { src: "/etc/nginx/sites-available/zaqar-nginx.conf", dest: "/etc/nginx/sites-enabled/zaqar-nginx.conf", state: "link" }
src: "/etc/nginx/sites-available/zaqar-nginx.conf"
dest: "/etc/nginx/sites-enabled/zaqar-nginx.conf"
state: "link"
notify:
- Restart Nginx
tags:

View File

@ -13,20 +13,15 @@
# See the License for the specific language governing permissions and
# limitations under the License.
- name: Copy zaqar servie config
- name: Copy zaqar service config
config_template:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
src: "zaqar.conf.j2"
dest: "/etc/zaqar/zaqar.conf"
owner: "{{ zaqar_system_user_name }}"
group: "{{ zaqar_system_group_name }}"
mode: "0644"
config_overrides: "{{ item.config_overrides }}"
config_type: "{{ item.config_type }}"
with_items:
- src: "zaqar.conf.j2"
dest: "/etc/zaqar/zaqar.conf"
config_overrides: "{{ zaqar_zaqar_conf_overrides }}"
config_type: "ini"
config_overrides: "{{ zaqar_zaqar_conf_overrides }}"
config_type: "ini"
# notify: Restart zaqar api
tags:
- zaqar-config
@ -34,8 +29,8 @@
- name: Copy zaqar logging config
copy:
src: "logging.conf"
dest: "/etc/zaqar/logging.conf"
src: "logging.conf"
dest: "/etc/zaqar/logging.conf"
# notify: Restart zaqar api
tags:
- zaqar-config

View File

@ -79,13 +79,11 @@
- name: Create zaqar log dir
file:
path: "{{ item.path }}"
path: "/var/log/zaqar"
state: directory
owner: "{{ item.owner|default(zaqar_system_user_name) }}"
group: "{{ item.group|default(zaqar_system_group_name) }}"
mode: "{{ item.mode|default('0755') }}"
with_items:
- { path: "/var/log/zaqar" }
owner: "{{ zaqar_system_user_name }}"
group: "{{ zaqar_system_group_name }}"
mode: "0755"
when: log_dir.rc != 0
tags:
- zaqar-dirs