-
Notifications
You must be signed in to change notification settings - Fork 77
/
01_install_virtualization_tools.yml
58 lines (51 loc) · 1.71 KB
/
01_install_virtualization_tools.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
---
- name: This play installs needed tools to provision infrastructure VMs
hosts: vm_host
become: true
tasks:
- name: Manage packets when distro is 'CentOS'
when: ansible_distribution == 'Fedora' or ansible_distribution == 'CentOS'
block:
- name: Upgrade all packages
ansible.builtin.yum:
name: "*"
state: latest # noqa package-latest
- name: Virtualization services are enabled
ansible.builtin.service:
name: virtqemud
state: started
enabled: true
- name: Install required packages
ansible.builtin.yum:
name: "{{ os_packages.centos }}"
state: latest # noqa package-latest
when:
- ansible_distribution == 'CentOS'
- name: Install required packages
ansible.builtin.yum:
name: "{{ os_packages.fedora }}"
state: present
when:
- ansible_distribution == 'Fedora'
- name: Manage packets when distro is 'Ubuntu'
when: ansible_distribution == 'Ubuntu'
block:
- name: Upgrade all packages
ansible.builtin.apt:
name: "*"
state: latest # noqa package-latest
- name: Install required packages
ansible.builtin.apt:
name: "{{ os_packages.ubuntu }}"
state: present
- name: Virtualization services are enabled
ansible.builtin.service:
name: libvirtd
state: started
enabled: true
- name: Download and provision Terraform
ansible.builtin.unarchive:
src: "{{ terraform_url }}"
dest: /usr/bin/
mode: "0755"
remote_src: true