From a0779110779dfc212e58cfc033c1bda58087c888 Mon Sep 17 00:00:00 2001 From: Juan Manuel Parrilla Date: Sun, 16 Nov 2014 16:32:32 +0100 Subject: [PATCH] fix lineinfile of python post task --- provisioning/group_vars/all | 2 +- .../roles/shelfzilla/tasks/post_python.yml | 2 +- .../roles/shelfzilla/tasks/shelfzilla.yml | 22 ++++++++++--------- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/provisioning/group_vars/all b/provisioning/group_vars/all index 955179e..f522809 100644 --- a/provisioning/group_vars/all +++ b/provisioning/group_vars/all @@ -1,3 +1,3 @@ shelfzilla_base_path: /opt/shelfzilla -shelfzillla_config_file: "{{ shelfzilla_base_path }}/shelfzilla.toml" +shelfzillla_config_file: 'shelfzilla.toml' system_init_path: /etc/init.d \ No newline at end of file diff --git a/provisioning/roles/shelfzilla/tasks/post_python.yml b/provisioning/roles/shelfzilla/tasks/post_python.yml index aa78b97..2ef632b 100644 --- a/provisioning/roles/shelfzilla/tasks/post_python.yml +++ b/provisioning/roles/shelfzilla/tasks/post_python.yml @@ -6,7 +6,7 @@ - lineinfile: dest="{{shelfzilla_base_path}}/shelfzilla/settings/configfile.py" regexp="^(.*)os\.environ\[\'APP\_CONFIGFILE\'\](.*)$" state=present - line="\'\1{{ shelfzillla_config_file }}\2\'" + line="\1\'{{ shelfzilla_base_path }}/{{ shelfzillla_config_file }}\'\2" backrefs=yes sudo: yes diff --git a/provisioning/roles/shelfzilla/tasks/shelfzilla.yml b/provisioning/roles/shelfzilla/tasks/shelfzilla.yml index 64c9c8a..2315176 100644 --- a/provisioning/roles/shelfzilla/tasks/shelfzilla.yml +++ b/provisioning/roles/shelfzilla/tasks/shelfzilla.yml @@ -70,19 +70,21 @@ - stat: path="{{ logfile }}" register: st -- name: Create Logfile - file: path="{{ logfile }}" - owner=root - group=root - mode=0666 - state=file - sudo: yes - when: not st.stat.exists - -- name: Create Static base path +- name: Create LogPath file: path="{{ logpath }}" owner=root group=root mode=0755 state=directory sudo: yes + +- name: Create Logfile + file: path="{{ logfile }}" + owner=root + group=root + mode=0666 + state=touch + sudo: yes + when: not st.stat.exists + +