From b91c1adace0619bdccb2f42b4ec1320bf355975c Mon Sep 17 00:00:00 2001 From: Pig Monkey Date: Tue, 30 Apr 2019 21:05:39 -0700 Subject: [PATCH] misc formatting --- roles/base/handlers/main.yml | 9 +++++++-- roles/base/tasks/user.yml | 35 +++++++++++++++++++++++++++------ roles/himawaripy/tasks/main.yml | 22 +++++++++++++-------- roles/mail/tasks/mailsync.yml | 13 +++++++++--- 4 files changed, 60 insertions(+), 19 deletions(-) diff --git a/roles/base/handlers/main.yml b/roles/base/handlers/main.yml index 7ba03e2..0767911 100644 --- a/roles/base/handlers/main.yml +++ b/roles/base/handlers/main.yml @@ -1,5 +1,10 @@ --- - name: restart paccache - service: name=paccache.timer state=restarted + service: + name: paccache.timer + state: restarted + - name: stop systemd per-user instance - service: name="user@{{ user.uid }}" state=stopped + service: + name: "user@{{ user.uid }}" + state: stopped diff --git a/roles/base/tasks/user.yml b/roles/base/tasks/user.yml index eeb5fc1..c3febbf 100644 --- a/roles/base/tasks/user.yml +++ b/roles/base/tasks/user.yml @@ -1,33 +1,56 @@ --- - name: Create user group - group: name={{ user.group }} state=present + group: + name: "{{ user.group }}" + state: present tags: - user - name: Create user and assign to group - user: name={{ user.name }} group={{ user.group }} password={{ user_password|password_hash('sha512') }} shell={{ user.shell }} update_password=on_create uid={{ user.uid }} groups=uucp append=yes + user: + name: "{{ user.name }}" + group: "{{ user.group }}" + password: "{{ user_password|password_hash('sha512') }}" + shell: "{{ user.shell }}" + update_password: on_create + uid: "{{ user.uid }}" + groups: uucp + append: yes tags: - user - name: Create user log dir - file: path=/home/{{ user.name }}/{{ user.log.dir }} state=directory owner={{ user.name }} group={{ user.group }} + file: + path: /home/{{ user.name }}/{{ user.log.dir }} + state: directory + owner: "{{ user.name }}" + group: "{{ user.group }}" when: user.log.dir is defined tags: - user - name: Push logrotate config for user logs - template: src=logrotate.j2 dest=/etc/logrotate.d/user + template: + src: logrotate.j2 + dest: /etc/logrotate.d/user when: user.log.dir is defined tags: - user - name: Create user socket directory - file: path=/run/user/{{ user.uid }} state=directory owner={{ user.name }} group={{ user.group }} mode=0700 + file: + path: /run/user/{{ user.uid }} + state: directory + owner: "{{ user.name }}" + group: "{{ user.group }}" + mode: 0700 tags: - user - name: Start user systemd instance - service: name="user@{{ user.uid }}" state=started + service: + name: "user@{{ user.uid }}" + state: started notify: stop systemd per-user instance tags: - user diff --git a/roles/himawaripy/tasks/main.yml b/roles/himawaripy/tasks/main.yml index 109339e..4110f35 100644 --- a/roles/himawaripy/tasks/main.yml +++ b/roles/himawaripy/tasks/main.yml @@ -1,21 +1,27 @@ --- - name: Install himawaripy into virtual environment - pip: name=git+https://github.com/boramalper/himawaripy#egg=himawaripy - virtualenv=/usr/local/env/himawaripy - virtualenv_command=virtualenv3 + pip: + name: git+https://github.com/boramalper/himawaripy#egg=himawaripy + virtualenv: /usr/local/env/himawaripy + virtualenv_command: virtualenv3 - name: Link himawaripy to bin - file: src=/usr/local/env/himawaripy/bin/himawaripy - dest=/usr/local/bin/himawaripy - state=link + file: + src: /usr/local/env/himawaripy/bin/himawaripy + dest: /usr/local/bin/himawaripy + state: link - name: Push himawaripy service file - template: src=himawaripy.service.j2 dest=/etc/systemd/user/himawaripy.service + template: + src: himawaripy.service.j2 + dest: /etc/systemd/user/himawaripy.service notify: - reload systemd config - name: Push himawaripy timer file - template: src=himawaripy.timer.j2 dest=/etc/systemd/user/himawaripy.timer + template: + src: himawaripy.timer.j2 + dest: /etc/systemd/user/himawaripy.timer notify: - reload systemd config - restart himawaripy diff --git a/roles/mail/tasks/mailsync.yml b/roles/mail/tasks/mailsync.yml index f4d0b5b..a268da7 100644 --- a/roles/mail/tasks/mailsync.yml +++ b/roles/mail/tasks/mailsync.yml @@ -1,18 +1,25 @@ --- - name: Push mail sync script - template: src=mailsync.sh.j2 dest=/usr/local/bin/mailsync mode=755 + template: + src: mailsync.sh.j2 + dest: /usr/local/bin/mailsync + mode: 755 tags: - mailsync - name: Push mailsync service file - template: src=mailsync.service.j2 dest=/etc/systemd/user/mailsync.service + template: + src: mailsync.service.j2 + dest: /etc/systemd/user/mailsync.service tags: - mailsync notify: - reload systemd config - name: Push mailsync timer file - template: src=mailsync.timer.j2 dest=/etc/systemd/user/mailsync.timer + template: + src: mailsync.timer.j2 + dest: /etc/systemd/user/mailsync.timer tags: - mailsync notify: