diff options
author | Emil Renner Berthing <esmil@labitat.dk> | 2019-07-09 17:03:31 +0200 |
---|---|---|
committer | Emil Renner Berthing <esmil@labitat.dk> | 2019-07-09 17:03:31 +0200 |
commit | f83816c4549368e4dfa2c2b7556726ecaef10164 (patch) | |
tree | bf2f2840817c693a0b2141265cbe6125bf4476f3 /roles/doorputer/tasks | |
parent | 18629c52f8d3d411cc52208e74bfbfc5862996d4 (diff) | |
download | labitat-ansible-f83816c4549368e4dfa2c2b7556726ecaef10164.tar.gz labitat-ansible-f83816c4549368e4dfa2c2b7556726ecaef10164.tar.xz labitat-ansible-f83816c4549368e4dfa2c2b7556726ecaef10164.zip |
doorputer: lockserver: handle updated lockserver
Diffstat (limited to 'roles/doorputer/tasks')
-rw-r--r-- | roles/doorputer/tasks/lockserver.yml | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/roles/doorputer/tasks/lockserver.yml b/roles/doorputer/tasks/lockserver.yml index 57b9e2b..033e80d 100644 --- a/roles/doorputer/tasks/lockserver.yml +++ b/roles/doorputer/tasks/lockserver.yml @@ -37,14 +37,25 @@ chdir: '/home/doorman' creates: '/home/doorman/users.db' -- name: Create pasword file - copy: - dest: '~doorman/lockserver.password' - content: "{{ doorputer_webpassword }}\n" +- name: Make sure ~doorman/.config exists + file: + dest: '~doorman/.config' + state: directory + owner: doorman + group: users + mode: 0700 + +- name: Create lockserver.ini + ini_file: + path: '~doorman/.config/lockserver.ini' + section: "{{ item.key.split('.',1)[0] }}" + option: "{{ item.key.split('.',1)[1] }}" + value: "{{ item.value|ternary(item.value,omit) }}" + state: "{{ item.value|ternary('present','absent') }}" owner: doorman group: users mode: 0600 - when: doorputer_webpassword is defined + with_dict: '{{ lockserver_conf }}' - name: Install lockserver service copy: |