Verified Commit a4a4f3e7 authored by Frederik Schwan's avatar Frederik Schwan Committed by Sven-Hendrik Haase
Browse files

fix E303 'Using command rather than module'

also use systemd instead of service module
parent fc769a7b
---
- name: daemon reload
command: systemctl daemon-reload
...@@ -15,13 +15,13 @@ ...@@ -15,13 +15,13 @@
with_items: with_items:
- syncrepo_arch32.timer - syncrepo_arch32.timer
- syncrepo_arch32.service - syncrepo_arch32.service
notify:
- daemon reload
- name: start and enable syncrepo unit - name: start and enable syncrepo unit
service: name={{ item }} enabled=yes state=started systemd:
with_items: name: syncrepo_arch32.timer
- syncrepo_arch32.timer enabled: yes
state: started
daemon_reload: yes
- name: make nginx log dir - name: make nginx log dir
file: path=/var/log/nginx/{{ arch32_mirror_domain }} state=directory owner=root group=root mode=0755 file: path=/var/log/nginx/{{ arch32_mirror_domain }} state=directory owner=root group=root mode=0755
......
--- ---
- name: daemon reload - name: daemon reload
command: systemctl daemon-reload systemd:
daemon-reload: yes
---
- name: daemon reload
command: systemctl daemon-reload
...@@ -73,10 +73,12 @@ ...@@ -73,10 +73,12 @@
loop: loop:
- archive-uploader.service - archive-uploader.service
- archive-uploader.timer - archive-uploader.timer
notify:
- daemon reload
when: not archive_nginx_only when: not archive_nginx_only
- name: start uploader timer - name: start uploader timer
service: name=archive-uploader.timer state=started enabled=yes systemd:
name: archive-uploader.timer
enabled: yes
state: started
daemon_reload: yes
when: not archive_nginx_only when: not archive_nginx_only
--- ---
- name: daemon reload - name: daemon reload
command: systemctl daemon-reload systemd:
daemon-reload: yes
- name: restart archweb memcached - name: restart archweb memcached
service: name=archweb-memcached state=restarted service: name=archweb-memcached state=restarted
...@@ -257,12 +257,15 @@ ...@@ -257,12 +257,15 @@
when: archweb_site and (release.changed or config.changed or virtualenv.changed or archweb_forced_deploy) when: archweb_site and (release.changed or config.changed or virtualenv.changed or archweb_forced_deploy)
notify: restart archweb memcached notify: restart archweb memcached
- name: start and enable archweb memcached service - name: start and enable archweb memcached service and archweb-rsync_iso timer
service: name="archweb-memcached.service" enabled=yes state=started systemd:
when: archweb_site|bool name: "{{ item }}"
enabled: yes
- name: start and enable archweb rsync iso timer state: started
service: name="archweb-rsync_iso.timer" enabled=yes state=started daemon_reload: yes
with_items:
- archweb-memcached.service
- archweb-rsync_iso.timer
when: archweb_site|bool when: archweb_site|bool
- name: start and enable archweb reporead service - name: start and enable archweb reporead service
...@@ -289,12 +292,15 @@ ...@@ -289,12 +292,15 @@
service: name="archweb-planet.timer" enabled=yes state=started service: name="archweb-planet.timer" enabled=yes state=started
when: archweb_planet when: archweb_planet
- name: start and enable archweb donor_import timer - name: start and enable archweb donor_import and archweb-dump_donor_mail timer
service: name="archweb-donor_import.timer" enabled=yes state=started systemd:
when: archweb_donor_import|bool name: "{{ item }}"
enabled: yes
- name: start and enable archweb dump donor timer state: started
service: name="archweb-dump_donor_mail.timer" enabled=yes state=started daemon_reload: yes
with_items:
- archweb-donor_import.timer
- archweb-dump_donor_mail.timer
when: archweb_donor_import|bool when: archweb_donor_import|bool
- name: create retro dir - name: create retro dir
......
--- ---
- name: daemon reload
command: systemctl daemon-reload
- name: restart php-fpm@archwiki - name: restart php-fpm@archwiki
service: name=php-fpm@{{ archwiki_user }} state=restarted service: name=php-fpm@{{ archwiki_user }} state=restarted
......
...@@ -97,20 +97,23 @@ ...@@ -97,20 +97,23 @@
- archwiki-question-updater.service - archwiki-question-updater.service
- archwiki-memcached.service - archwiki-memcached.service
- name: start and enable archwiki runjobs timer - name: start and enable archwiki timers and services
service: name="archwiki-runjobs.timer" enabled=yes state=started systemd:
name: "{{ item }}"
- name: start and enable archwiki prune cache timer enabled: yes
service: name="archwiki-prune-cache.timer" enabled=yes state=started state: started
daemon_reload: yes
- name: start and enable archwiki runjobs wait service with_items:
service: name="archwiki-runjobs-wait.service" enabled=yes state=started - archwiki-runjobs.timer
- archwiki-prune-cache.timer
- archwiki-runjobs-wait.service
- archwiki-memcached.service
- name: create question answer file - name: create question answer file
service: name=archwiki-question-updater.service state=started systemd:
name: archwiki-question-updater.service
- name: start and enable archwiki memcached state: started
service: name=archwiki-memcached.service enabled=yes state=started daemon_reload: yes
- name: ensure question answer file exists and set permissions - name: ensure question answer file exists and set permissions
file: state=file path="{{ archwiki_question_answer_file }}" owner=root group=root mode=0644 file: state=file path="{{ archwiki_question_answer_file }}" owner=root group=root mode=0644
......
---
- name: daemon reload
command: systemctl daemon-reload
...@@ -14,11 +14,13 @@ ...@@ -14,11 +14,13 @@
with_items: with_items:
- certbot-renewal.service - certbot-renewal.service
- certbot-renewal.timer - certbot-renewal.timer
notify:
- daemon reload
- name: activate letsencrypt renewal service - name: activate letsencrypt renewal service
service: name=certbot-renewal.timer enabled=yes state=started systemd:
name: certbot-renewal.timer
enabled: yes
state: started
daemon_reload: yes
- name: open firewall holes for certbot standalone authenticator - name: open firewall holes for certbot standalone authenticator
firewalld: service={{ item }} permanent=true state=enabled immediate=yes firewalld: service={{ item }} permanent=true state=enabled immediate=yes
......
--- ---
- name: restart networkd - name: restart networkd
service: name=systemd-networkd state=restarted systemd:
name: systemd-networkd
state: resarted
daemon_reload: yes
- name: restarted journald - name: restart journald
service: name=systemd-journald state=restarted systemd:
name: systemd-journald
state: restarted
daemon_reload: yes
- name: systemd daemon-reload - name: systemd daemon-reload
command: systemctl daemon-reload systemd:
daemon_reload: yes
- name: restart syslog-ng - name: restart syslog-ng
service: name=syslog-ng@default state=restarted service: name=syslog-ng@default state=restarted
......
...@@ -201,6 +201,8 @@ ...@@ -201,6 +201,8 @@
become_user: svntogit become_user: svntogit
register: git_config_username register: git_config_username
changed_when: "git_config_username.rc == 0" changed_when: "git_config_username.rc == 0"
tags:
- skip_ansible_lint
- name: configure svntogit git user email - name: configure svntogit git user email
command: git config --global user.name = 'svntogit@repos.archlinux.org' command: git config --global user.name = 'svntogit@repos.archlinux.org'
...@@ -208,6 +210,8 @@ ...@@ -208,6 +210,8 @@
become_user: svntogit become_user: svntogit
register: git_config_email register: git_config_email
changed_when: "git_config_email.rc == 0" changed_when: "git_config_email.rc == 0"
tags:
- skip_ansible_lint
- name: template arch-svntogit - name: template arch-svntogit
copy: src=update-repos.sh dest=/srv/svntogit/update-repos.sh owner=root group=root mode=0755 copy: src=update-repos.sh dest=/srv/svntogit/update-repos.sh owner=root group=root mode=0755
...@@ -222,6 +226,8 @@ ...@@ -222,6 +226,8 @@
- packages - packages
become: yes become: yes
become_user: svntogit become_user: svntogit
tags:
- skip_ansible_lint
- name: add svntogit public remotes - name: add svntogit public remotes
command: git remote add public ssh://git.archlinux.org/srv/git/svntogit/{{ item }}.git chdir=/srv/svntogit/repos/{{ item }} command: git remote add public ssh://git.archlinux.org/srv/git/svntogit/{{ item }}.git chdir=/srv/svntogit/repos/{{ item }}
...@@ -233,6 +239,8 @@ ...@@ -233,6 +239,8 @@
ignore_errors: yes ignore_errors: yes
register: git_public_remote register: git_public_remote
changed_when: "git_public_remote.rc == 0" changed_when: "git_public_remote.rc == 0"
tags:
- skip_ansible_lint
# The following command also serves as a way to get the data the first time the repo is set up # The following command also serves as a way to get the data the first time the repo is set up
- name: configure svntogit pull upstream branch - name: configure svntogit pull upstream branch
...@@ -244,6 +252,8 @@ ...@@ -244,6 +252,8 @@
become_user: svntogit become_user: svntogit
register: git_pull_upstream register: git_pull_upstream
changed_when: "git_pull_upstream.rc == 0" changed_when: "git_pull_upstream.rc == 0"
tags:
- skip_ansible_lint
- name: configure svntogit push upstream branch - name: configure svntogit push upstream branch
command: git push -u public master chdir=/srv/svntogit/repos/{{ item }} command: git push -u public master chdir=/srv/svntogit/repos/{{ item }}
...@@ -254,6 +264,8 @@ ...@@ -254,6 +264,8 @@
become_user: svntogit become_user: svntogit
register: git_push_master register: git_push_master
changed_when: "git_push_master.rc == 0" changed_when: "git_push_master.rc == 0"
tags:
- skip_ansible_lint
- name: fix svntogit home permissions - name: fix svntogit home permissions
file: path="/srv/svntogit" state=directory owner=svntogit group=svntogit mode=0775 file: path="/srv/svntogit" state=directory owner=svntogit group=svntogit mode=0775
......
---
- name: daemon reload
command: systemctl daemon-reload
...@@ -16,13 +16,13 @@ ...@@ -16,13 +16,13 @@
- name: install docker_image service - name: install docker_image service
template: src='docker-image.service.j2' dest='/etc/systemd/system/docker-image.service' owner=root group=root mode=0644 template: src='docker-image.service.j2' dest='/etc/systemd/system/docker-image.service' owner=root group=root mode=0644
notify:
- daemon reload
- name: install docker_image timer - name: install docker_image timer
template: src='docker-image.timer.j2' dest='/etc/systemd/system/docker-image.timer' owner=root group=root mode=0644 template: src='docker-image.timer.j2' dest='/etc/systemd/system/docker-image.timer' owner=root group=root mode=0644
notify:
- daemon reload
- name: start and enable docker_image_build timer - name: start and enable docker_image_build timer
service: name='docker-image.timer' enabled=yes state=started systemd:
name: docker-image.timer
enabled: yes
state: started
daemon_reload: yes
---
- name: daemon reload
command: systemctl daemon-reload
- name: restart php-fpm@flyspray
service: name=php-fpm@flyspray state=restarted
...@@ -54,25 +54,49 @@ ...@@ -54,25 +54,49 @@
dest: /tmp/ dest: /tmp/
- name: extract boostrap image - name: extract boostrap image
command: tar xf archlinux-bootstrap-{{ bootstrap_version }}-x86_64.tar.gz unarchive:
args: src: /tmp/archlinux-bootstrap-{{ bootstrap_version }}-x86_64.tar.gz
chdir: /tmp dest: /tmp
creates: /tmp/root.x86_64 creates: /tmp/root.x86_64
- name: copy resolv.conf to bootstrap chroot - name: copy resolv.conf to bootstrap chroot
copy: remote_src=True src=/etc/resolv.conf dest=/tmp/root.x86_64/etc/resolv.conf copy: remote_src=True src=/etc/resolv.conf dest=/tmp/root.x86_64/etc/resolv.conf
- name: mount /proc to bootstrap chroot - name: mount /proc to bootstrap chroot
command: mount --rbind /proc /tmp/root.x86_64/proc creates=/tmp/root.x86_64/proc/uptime mount:
src: /proc
path: /tmp/root.x86_64/proc
opts: rbind
state: mounted
fstype: none
fstab: /dev/null
- name: mount /sys to bootstrap chroot - name: mount /sys to bootstrap chroot
command: mount --rbind /sys /tmp/root.x86_64/sys creates=/tmp/root.x86_64/sys/dev mount:
src: /sys
path: /tmp/root.x86_64/sys
opts: rbind
state: mounted
fstype: none
fstab: /dev/null
- name: mount /dev to bootstrap chroot - name: mount /dev to bootstrap chroot
command: mount --rbind /dev /tmp/root.x86_64/dev creates=/tmp/root.x86_64/dev/zero mount:
src: /dev
path: /tmp/root.x86_64/dev
opts: rbind
state: mounted
fstype: none
fstab: /dev/null
- name: mount /mnt to bootstrap chroot - name: mount /mnt to bootstrap chroot
command: mount --rbind /mnt /tmp/root.x86_64/mnt creates=/tmp/root.x86_64/mnt/LOCK mount:
src: /mnt
path: /tmp/root.x86_64/mnt
opts: rbind
state: mounted
fstype: none
fstab: /dev/null
- name: configure pacman mirror - name: configure pacman mirror
template: src=mirrorlist.j2 dest=/tmp/root.x86_64/etc/pacman.d/mirrorlist owner=root group=root mode=0644 template: src=mirrorlist.j2 dest=/tmp/root.x86_64/etc/pacman.d/mirrorlist owner=root group=root mode=0644
...@@ -101,13 +125,32 @@ ...@@ -101,13 +125,32 @@
creates: /tmp/root.x86_64/mnt/bin creates: /tmp/root.x86_64/mnt/bin
- name: mount /proc to new chroot - name: mount /proc to new chroot
command: mount --rbind /proc /mnt/proc creates=/mnt/proc/uptime mount:
src: /proc
path: /mnt/proc
opts: rbind
state: mounted
fstype: none
fstab: /dev/null
- name: mount /sys to new chroot - name: mount /sys to new chroot
command: mount --rbind /sys /mnt/sys creates=/mnt/sys/dev mount:
src: /sys
path: /mnt/sys
opts: rbind
state: mounted
fstype: none
fstab: /dev/null
- name: mount /dev to new chroot - name: mount /dev to new chroot
command: mount --rbind /dev /mnt/dev creates=/mnt/dev/zero mount:
src: /dev
path: /mnt/dev
opts: rbind
state: mounted
fstype: none
fstab: /dev/null
when: not stat_result_dev.stat.exists
- name: generate mdadm.conf - name: generate mdadm.conf
shell: mdadm --detail --scan >> /mnt/etc/mdadm.conf shell: mdadm --detail --scan >> /mnt/etc/mdadm.conf
......
...@@ -5,6 +5,3 @@ ...@@ -5,6 +5,3 @@
- name: reload nginx - name: reload nginx
service: name=nginx state=reloaded service: name=nginx state=reloaded
- name: daemon reload
command: systemctl daemon-reload
--- ---
- name: daemon reload
command: systemctl daemon-reload
- name: restart patchwork memcached - name: restart patchwork memcached
service: name=patchwork-memcached state=restarted service: name=patchwork-memcached state=restarted
...@@ -121,8 +121,12 @@ ...@@ -121,8 +121,12 @@
file: path=/etc/uwsgi/vassals/patchwork.ini state=touch file: path=/etc/uwsgi/vassals/patchwork.ini state=touch
when: (release.changed or config.changed or virtualenv.changed or patchwork_forced_deploy) when: (release.changed or config.changed or virtualenv.changed or patchwork_forced_deploy)
- name: start and enable patchwork memcached service - name: start and enable patchwork memcached service and notification timer
service: name="patchwork-memcached.service" enabled=yes state=started systemd:
name: "{{ item }}"
- name: start and enable patchwork notification timer enabled: yes
service: name="patchwork-notification.timer" enabled=yes state=started state: started
daemon_reload: yes
with_items:
- patchwork-memcached.service
- patchwork-notification.timer
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment