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 @@
with_items:
- syncrepo_arch32.timer
- syncrepo_arch32.service
notify:
- daemon reload
- name: start and enable syncrepo unit
service: name={{ item }} enabled=yes state=started
with_items:
- syncrepo_arch32.timer
systemd:
name: syncrepo_arch32.timer
enabled: yes
state: started
daemon_reload: yes
- name: make nginx log dir
file: path=/var/log/nginx/{{ arch32_mirror_domain }} state=directory owner=root group=root mode=0755
......
---
- name: daemon reload
command: systemctl daemon-reload
systemd:
daemon-reload: yes
---
- name: daemon reload
command: systemctl daemon-reload
......@@ -73,10 +73,12 @@
loop:
- archive-uploader.service
- archive-uploader.timer
notify:
- daemon reload
when: not archive_nginx_only
- 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
---
- name: daemon reload
command: systemctl daemon-reload
systemd:
daemon-reload: yes
- name: restart archweb memcached
service: name=archweb-memcached state=restarted
......@@ -257,12 +257,15 @@
when: archweb_site and (release.changed or config.changed or virtualenv.changed or archweb_forced_deploy)
notify: restart archweb memcached
- name: start and enable archweb memcached service
service: name="archweb-memcached.service" enabled=yes state=started
when: archweb_site|bool
- name: start and enable archweb rsync iso timer
service: name="archweb-rsync_iso.timer" enabled=yes state=started
- name: start and enable archweb memcached service and archweb-rsync_iso timer
systemd:
name: "{{ item }}"
enabled: yes
state: started
daemon_reload: yes
with_items:
- archweb-memcached.service
- archweb-rsync_iso.timer
when: archweb_site|bool
- name: start and enable archweb reporead service
......@@ -289,12 +292,15 @@
service: name="archweb-planet.timer" enabled=yes state=started
when: archweb_planet
- name: start and enable archweb donor_import timer
service: name="archweb-donor_import.timer" enabled=yes state=started
when: archweb_donor_import|bool
- name: start and enable archweb dump donor timer
service: name="archweb-dump_donor_mail.timer" enabled=yes state=started
- name: start and enable archweb donor_import and archweb-dump_donor_mail timer
systemd:
name: "{{ item }}"
enabled: yes
state: started
daemon_reload: yes
with_items:
- archweb-donor_import.timer
- archweb-dump_donor_mail.timer
when: archweb_donor_import|bool
- name: create retro dir
......
---
- name: daemon reload
command: systemctl daemon-reload
- name: restart php-fpm@archwiki
service: name=php-fpm@{{ archwiki_user }} state=restarted
......
......@@ -97,20 +97,23 @@
- archwiki-question-updater.service
- archwiki-memcached.service
- name: start and enable archwiki runjobs timer
service: name="archwiki-runjobs.timer" enabled=yes state=started
- name: start and enable archwiki prune cache timer
service: name="archwiki-prune-cache.timer" enabled=yes state=started
- name: start and enable archwiki runjobs wait service
service: name="archwiki-runjobs-wait.service" enabled=yes state=started
- name: start and enable archwiki timers and services
systemd:
name: "{{ item }}"
enabled: yes
state: started
daemon_reload: yes
with_items:
- archwiki-runjobs.timer
- archwiki-prune-cache.timer
- archwiki-runjobs-wait.service
- archwiki-memcached.service
- name: create question answer file
service: name=archwiki-question-updater.service state=started
- name: start and enable archwiki memcached
service: name=archwiki-memcached.service enabled=yes state=started
systemd:
name: archwiki-question-updater.service
state: started
daemon_reload: yes
- name: ensure question answer file exists and set permissions
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 @@
with_items:
- certbot-renewal.service
- certbot-renewal.timer
notify:
- daemon reload
- 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
firewalld: service={{ item }} permanent=true state=enabled immediate=yes
......
---
- name: restart networkd
service: name=systemd-networkd state=restarted
systemd:
name: systemd-networkd
state: resarted
daemon_reload: yes
- name: restarted journald
service: name=systemd-journald state=restarted
- name: restart journald
systemd:
name: systemd-journald
state: restarted
daemon_reload: yes
- name: systemd daemon-reload
command: systemctl daemon-reload
systemd:
daemon_reload: yes
- name: restart syslog-ng
service: name=syslog-ng@default state=restarted
......
......@@ -201,6 +201,8 @@
become_user: svntogit
register: git_config_username
changed_when: "git_config_username.rc == 0"
tags:
- skip_ansible_lint
- name: configure svntogit git user email
command: git config --global user.name = 'svntogit@repos.archlinux.org'
......@@ -208,6 +210,8 @@
become_user: svntogit
register: git_config_email
changed_when: "git_config_email.rc == 0"
tags:
- skip_ansible_lint
- name: template arch-svntogit
copy: src=update-repos.sh dest=/srv/svntogit/update-repos.sh owner=root group=root mode=0755
......@@ -222,6 +226,8 @@
- packages
become: yes
become_user: svntogit
tags:
- skip_ansible_lint
- name: add svntogit public remotes
command: git remote add public ssh://git.archlinux.org/srv/git/svntogit/{{ item }}.git chdir=/srv/svntogit/repos/{{ item }}
......@@ -233,6 +239,8 @@
ignore_errors: yes
register: git_public_remote
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
- name: configure svntogit pull upstream branch
......@@ -244,6 +252,8 @@
become_user: svntogit
register: git_pull_upstream
changed_when: "git_pull_upstream.rc == 0"
tags:
- skip_ansible_lint
- name: configure svntogit push upstream branch
command: git push -u public master chdir=/srv/svntogit/repos/{{ item }}
......@@ -254,6 +264,8 @@
become_user: svntogit
register: git_push_master
changed_when: "git_push_master.rc == 0"
tags:
- skip_ansible_lint
- name: fix svntogit home permissions
file: path="/srv/svntogit" state=directory owner=svntogit group=svntogit mode=0775
......
---
- name: daemon reload
command: systemctl daemon-reload
......@@ -16,13 +16,13 @@
- name: install docker_image service
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
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
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 @@
dest: /tmp/
- name: extract boostrap image
command: tar xf archlinux-bootstrap-{{ bootstrap_version }}-x86_64.tar.gz
args:
chdir: /tmp
unarchive:
src: /tmp/archlinux-bootstrap-{{ bootstrap_version }}-x86_64.tar.gz
dest: /tmp
creates: /tmp/root.x86_64
- name: copy resolv.conf to bootstrap chroot
copy: remote_src=True src=/etc/resolv.conf dest=/tmp/root.x86_64/etc/resolv.conf
- 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
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
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
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
template: src=mirrorlist.j2 dest=/tmp/root.x86_64/etc/pacman.d/mirrorlist owner=root group=root mode=0644
......@@ -101,13 +125,32 @@
creates: /tmp/root.x86_64/mnt/bin
- 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
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
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
shell: mdadm --detail --scan >> /mnt/etc/mdadm.conf
......
......@@ -5,6 +5,3 @@
- name: reload nginx
service: name=nginx state=reloaded
- name: daemon reload
command: systemctl daemon-reload
---
- name: daemon reload
command: systemctl daemon-reload
- name: restart patchwork memcached
service: name=patchwork-memcached state=restarted
......@@ -121,8 +121,12 @@
file: path=/etc/uwsgi/vassals/patchwork.ini state=touch
when: (release.changed or config.changed or virtualenv.changed or patchwork_forced_deploy)
- name: start and enable patchwork memcached service
service: name="patchwork-memcached.service" enabled=yes state=started
- name: start and enable patchwork notification timer
service: name="patchwork-notification.timer" enabled=yes state=started
- name: start and enable patchwork memcached service and notification timer
systemd:
name: "{{ item }}"
enabled: yes
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