Skip to content

Commit fe43fea

Browse files
committed
common: Add Incus guest agent and Allow to uninstall Qemu guest agent
1 parent 771d91e commit fe43fea

File tree

3 files changed

+23
-8
lines changed

3 files changed

+23
-8
lines changed

roles/common/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ packages.
9494
| `common_grub_password` | | If specified, ensure Grub password is set to this value. |
9595
| `common_grub_save_default` | false | If `true` configure Grub to use the last used entry as default. |
9696
| `common_grub_timeout` | 1 | Grub timeout to set. |
97+
| `common_guest_incus` | false | If `true` Install Incus guest agent. |
9798
| `common_guest_qemu` | false | If `true` Install Qemu guest agent. |
9899
| `common_hostname` | | If specified, set hostname. |
99100
| `common_journal_disk_max_size` | | If specified, set systemd journal disk max size (`SystemMaxUse`). |

roles/common/defaults/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ common_random_mac_wifi: random
3737
common_random_mac_ethernet: stable
3838
common_ssh_hardening: true
3939
common_guest_qemu: false
40+
common_guest_incus: false
4041

4142
# Internal values
4243
_smtp_server: "[{{ common_mail_smtp_host }}]:{{ common_mail_smtp_port }}"

roles/common/tasks/guest.yml

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,34 @@
22

33
- name: Ensure Qemu guest agent is installed
44
ansible.builtin.dnf:
5-
state: present
5+
state: "{{common_guest_qemu | bool | ternary('present', 'absent')}}"
66
name: qemu-guest-agent
77
install_weak_deps: false
88
retries: 10
99
delay: 1
1010
register: _
1111
until: _ is successful
12-
when:
13-
- common_guest_qemu | bool
14-
- not (_ostree | bool)
12+
when: not (_ostree | bool)
1513

1614
- name: Ensure Qemu guest agent is installed
1715
community.general.rpm_ostree_pkg:
18-
state: present
16+
state: "{{common_guest_qemu | bool | ternary('present', 'absent')}}"
1917
name: qemu-guest-agent
20-
when:
21-
- common_guest_qemu | bool
22-
- _ostree | bool
18+
when: _ostree | bool
19+
20+
- name: Ensure Incus guest agent is installed
21+
ansible.builtin.dnf:
22+
state: "{{common_guest_incus | bool | ternary('present', 'absent')}}"
23+
name: incus-agent
24+
install_weak_deps: false
25+
retries: 10
26+
delay: 1
27+
register: _
28+
until: _ is successful
29+
when: not (_ostree | bool)
30+
31+
- name: Ensure Incus guest agent is installed
32+
community.general.rpm_ostree_pkg:
33+
state: "{{common_guest_incus | bool | ternary('present', 'absent')}}"
34+
name: incus-agent
35+
when: _ostree | bool

0 commit comments

Comments
 (0)