From d5da66cb520812e42274f974c338cf364fe505c7 Mon Sep 17 00:00:00 2001 From: Bert Van Vreckem Date: Thu, 12 May 2016 11:36:16 +0200 Subject: [PATCH] Start service before installing config. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fixes a catch-22 on Fedora. The lock file directory doesn’t exist before starting the service for a first time. --- tasks/main.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/tasks/main.yml b/tasks/main.yml index 34d50cb..a7b9b4c 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -49,7 +49,7 @@ setype: "{{ item.setype|default('samba_share_t') }}" tags: samba -- name: Ensute webserver document root exists +- name: Ensure webserver document root exists file: name: "{{ samba_www_documentroot }}" state: directory @@ -63,16 +63,6 @@ with_items: "{{ samba_shares }}" tags: samba -- name: Samba configuration - template: - dest: "{{ samba_configuration }}" - src: smb.conf.j2 - validate: 'testparm -s %s' - notify: - - Restart Samba - - Restart WinBind - tags: samba - - name: Start Samba service service: name: "{{ samba_service }}" @@ -87,6 +77,16 @@ enabled: yes tags: samba +- name: Samba configuration + template: + dest: "{{ samba_configuration }}" + src: smb.conf.j2 + validate: 'testparm -s %s' + notify: + - Restart Samba + - Restart WinBind + tags: samba + - name: Create Samba users if they don't exist yet shell: > (pdbedit -L | grep {{ item.name }} 2>&1 > /dev/null) \