From f1edd4fc2e890ddc3742cf1bb9f7ca5ceb18e5f0 Mon Sep 17 00:00:00 2001 From: Sebastian Haderecker Date: Mon, 15 Apr 2019 18:43:27 +0000 Subject: [PATCH] Use Ansible lineinfile for ews.cfg in tpot.yml ... instead of sed --- cloud/ansible/roles/custom_ews/tasks/main.yaml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/cloud/ansible/roles/custom_ews/tasks/main.yaml b/cloud/ansible/roles/custom_ews/tasks/main.yaml index 4e7eba4b..06404182 100644 --- a/cloud/ansible/roles/custom_ews/tasks/main.yaml +++ b/cloud/ansible/roles/custom_ews/tasks/main.yaml @@ -1,4 +1,4 @@ -- name: Install ews configuration file +- name: Copy ews configuration file template: src: ../templates/ews.cfg dest: /data/ews/conf @@ -6,8 +6,11 @@ group: root mode: 0644 -- name: Patching tpot.yml - raw: sed -i '/\/opt\/ewsposter\/ews.ip/a\\ \ \ \ \ - /data/ews/conf/ews.cfg:/opt/ewsposter/ews.cfg' /opt/tpot/etc/tpot.yml +- name: Patching tpot.yml with custom ews configuration file + lineinfile: + path: /opt/tpot/etc/tpot.yml + insertafter: '/opt/ewsposter/ews.ip' + line: ' - /data/ews/conf/ews.cfg:/opt/ewsposter/ews.cfg' - name: Lookup HPFEED environment variables set_fact: