blob: d22e8155ad508b627c12ebb6e86a06472cfea16b (
plain)
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
|
# Copyright (c) 2018 Intel Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
---
- name: Update apt cache
apt:
update_cache: yes
upgrade: yes
cache_valid_time: 36000
environment: "{{ proxy_env }}"
- name: Install packets
apt:
name: "{{ item }}"
with_items:
- python-tox
- python-dev
- libffi-dev
- libssl-dev
- python3-dev
- ethtool
- ipmitool
- git
- ntp
- apparmor-utils
- docker.io
- libvirt-bin
- python-setuptools
- build-essential
environment: "{{ proxy_env }}"
- name: Install pip
shell: easy_install pip
environment: "{{ proxy_env }}"
- name: Update pip ansible docker
pip:
name: "{{ item }}"
state: latest
with_items:
- ansible
- docker
- tox
- shade
environment: "{{ proxy_env }}"
- name: Remove conflicting packages
apt:
name: "{{ item }}"
state: absent
with_items:
- lxd
- lxc
- name: Stop and disable libvirt
systemd:
state: stopped
enabled: no
name: libvirt-bin.service
- name: Stop and disable apparmor service
systemd:
name: apparmor
state: stopped
enabled: no
- name: Get stat of libvirtd apparmor profile
stat:
path: /etc/apparmor.d/disable/usr.sbin.libvirtd
register: apparmor_libvirtd_profile
- name: Remove apparmor profile for libvirt
shell: ln -s /etc/apparmor.d/usr.sbin.libvirtd /etc/apparmor.d/disable/ && apparmor_parser -R /etc/apparmor.d/usr.sbin.libvirtd
when:
- apparmor_libvirtd_profile.stat.exists == False
|