qemu_guest_agent als rolle (#110)

qemu_guest_agent als rolle

Co-authored-by: Michael Grote <michael.grote@posteo.de>
Reviewed-on: mg/ansible#110
Co-Authored-By: mg <mg@noreply.git.mgrote.net>
Co-Committed-By: mg <mg@noreply.git.mgrote.net>
This commit is contained in:
Michael Grote 2021-06-08 07:48:24 +02:00
parent 451bb91a99
commit f408590a63
3 changed files with 25 additions and 5 deletions

View file

@ -6,18 +6,15 @@
- { role: robertdebock.bootstrap, tags: "bootstrap", become: yes}
- { role: ryandaniels.create_users, tags: "user", become: yes}
- { role: mgrote.r8152_kernel_module }
- { role: mgrote.qemu_guest_agent }
post_tasks:
- name: reboot für qemu-guest-agent (dauert bis zu 2min!)
become: true
reboot:
reboot_timeout: 120
- name: Change user password
become: true
user:
name: mg
update_password: always
password: "{{ lookup('keepass', 'mg_linux_password_hash', 'password') }}"
vars:
### reobertdebock.bootstrap
bootstrap_user: mg

View file

@ -0,0 +1,9 @@
## mgrote.qemu_guest_agent
### Beschreibung
Installiert den qemu-guest-agent und startet die VM danach neu.
Wird nur in VMs ausgeführt.
### Funktioniert auf
- [x] Ubuntu (>=18.04)
- [x] Debian

View file

@ -0,0 +1,14 @@
---
- name: install packages
become: yes
ansible.builtin.package:
name: qemu-guest-agent
state: present
when: ansible_virtualization_role == 'guest'
register: qemu_installed
- name: reboot (dauert bis zu 2min!)
become: true
reboot:
reboot_timeout: 120
when: qemu_installed.changed == true