Skip to content

Commit

Permalink
common: Add option to install Qemu gest agent
Browse files Browse the repository at this point in the history
  • Loading branch information
JGoutin committed Jul 26, 2024
1 parent 65eed05 commit 05f89e0
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions roles/common/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ packages.
| `common_grub_hidden_timeout` | 0 | Grub hidden timeout to set. |
| `common_grub_password` | | If specified, ensure Grub password is set to this value. |
| `common_grub_timeout` | 1 | Grub timeout to set. |
| `common_guest_qemu` | false | If `true` Install Qemu guest agent. |
| `common_hostname` | | If specified, set hostname. |
| `common_journal_disk_max_size` | | If specified, set systemd journal disk max size (`SystemMaxUse`). |
| `common_journal_memory_max_size` | | If specified, set systemd journal memory max size (`RuntimeMaxUse`). |
Expand Down
1 change: 1 addition & 0 deletions roles/common/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ common_random_mac: false
common_random_mac_wifi: random
common_random_mac_ethernet: stable
common_ssh_hardening: true
common_guest_qemu: false

# Internal values
_smtp_server: "[{{ common_mail_smtp_host }}]:{{ common_mail_smtp_port }}"
Expand Down
22 changes: 22 additions & 0 deletions roles/common/tasks/guest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---

- name: Ensure Qemu guest agent is installed
ansible.builtin.dnf:
state: present
name: qemu-guest-agent
install_weak_deps: false
retries: 10
delay: 1
register: _
until: _ is successful
when:
- common_guest_qemu | bool
- not (_ostree | bool)

- name: Ensure Qemu guest agent is installed
community.general.rpm_ostree_pkg:
state: present
name: qemu-guest-agent
when:
- common_guest_qemu | bool
- _ostree | bool
3 changes: 3 additions & 0 deletions roles/common/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@
ansible.builtin.include_tasks: mount_smb.yml
when: common_smb_mount is defined

- name: Guest VM configuration
ansible.builtin.include_tasks: guest.yml

- name: Fail2ban configuration
ansible.builtin.include_tasks: fail2ban.yml

Expand Down

0 comments on commit 05f89e0

Please sign in to comment.