From c88ecfa8269da0ffe729de6c577623aa72922bd4 Mon Sep 17 00:00:00 2001 From: Jesse Pretorius Date: Tue, 2 Aug 2016 09:19:33 +0100 Subject: [PATCH] Fix ansible performance issue When a task is included, contains variables within the include, and loads other tasks with conditionals that iterate (using a lookup plugin) Ansible will spinlock for ~30 seconds per item per task. To resolve this the iteration using the lookup plugin was removed and the task broken out into individual tasks. Change-Id: I2f979c950217f85340fbb22a8c9151b5605753f7 --- tasks/ironic_init_systemd.yml | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/tasks/ironic_init_systemd.yml b/tasks/ironic_init_systemd.yml index bf20d4b3..b7301545 100644 --- a/tasks/ironic_init_systemd.yml +++ b/tasks/ironic_init_systemd.yml @@ -13,16 +13,21 @@ # See the License for the specific language governing permissions and # limitations under the License. -- name: Create ironic TEMP dirs +- name: Create TEMP run dir file: - path: "{{ item.path }}/{{ program_name }}" + path: "/var/run/{{ program_name }}" state: directory owner: "{{ system_user }}" group: "{{ system_group }}" - mode: 02755 - with_items: - - { path: "/var/run" } - - { path: "/var/lock" } + mode: "02755" + +- name: Create TEMP lock dir + file: + path: "/var/lock/{{ program_name }}" + state: directory + owner: "{{ system_user }}" + group: "{{ system_group }}" + mode: "02755" - name: Create tempfile.d entry template: