From 06dc9beff18268ab5c4d0d73211ee48927ace8be Mon Sep 17 00:00:00 2001 From: Travis Truman Date: Wed, 20 Apr 2016 11:54:55 -0400 Subject: [PATCH] Remove unneeded with_items usage for clarity Using with_items with a single item makes the tasks overly complex to read/maintain Change-Id: Ib7f6e4854e8b369f0331751a89883dc857b8f5a5 --- extras/os-designate-install.yml | 12 ++++-------- tasks/designate_pre_install.yml | 10 ++++------ 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/extras/os-designate-install.yml b/extras/os-designate-install.yml index 7ee8f58..8386940 100644 --- a/extras/os-designate-install.yml +++ b/extras/os-designate-install.yml @@ -52,22 +52,18 @@ rabbitmq_servers: "{{ servers.sorted_list }}" - name: Create log dir file: - path: "{{ item.path }}" + path: "/openstack/log/{{ inventory_hostname }}-designate" state: directory - with_items: - - { path: "/openstack/log/{{ inventory_hostname }}-designate" } when: is_metal | bool tags: - designate-logs - designate-log-dirs - name: Create log aggregation links file: - src: "{{ item.src }}" - dest: "{{ item.dest }}" - state: "{{ item.state }}" + src: "/openstack/log/{{ inventory_hostname }}-designate" + dest: "/var/log/designate" + state: "link" force: "yes" - with_items: - - { src: "/openstack/log/{{ inventory_hostname }}-designate", dest: "/var/log/designate", state: "link" } when: is_metal | bool tags: - designate-logs diff --git a/tasks/designate_pre_install.yml b/tasks/designate_pre_install.yml index fbdba0f..356aff3 100644 --- a/tasks/designate_pre_install.yml +++ b/tasks/designate_pre_install.yml @@ -78,13 +78,11 @@ - name: Create designate log dir file: - path: "{{ item.path }}" + path: "/var/log/designate" state: directory - owner: "{{ item.owner|default(designate_system_user_name) }}" - group: "{{ item.group|default(designate_system_group_name) }}" - mode: "{{ item.mode|default('0755') }}" - with_items: - - { path: "/var/log/designate" } + owner: "{{ designate_system_user_name }}" + group: "{{ designate_system_group_name }}" + mode: "0755" when: log_dir.rc != 0 tags: - designate-dirs