Use block for become

This commit is contained in:
pgrondek 2020-05-26 00:02:14 +02:00
parent 6b7bb404bd
commit 3200471f68
2 changed files with 40 additions and 41 deletions

View File

@ -1,6 +1,7 @@
---
- become: yes
block:
- name: install needed tools
become: yes
apt:
update_cache: yes
pkg:
@ -13,7 +14,6 @@
- build-essential
- name: install octoprint software
become: yes
become_user: octoprint
shell:
chdir: /home/octoprint

View File

@ -1,19 +1,18 @@
---
- become: yes
block:
- name: copy systemd service config
become: yes
copy:
src: octoprint.service
dest: /lib/systemd/system/octoprint.service
- name: enable systemd service
become: yes
systemd:
name: octoprint
enabled: yes
state: started
- name: enable octoprint to restart itself
become: yes
copy:
src: sudoers.conf
dest: /etc/sudoers.d/octoprint