kolla-ansible/ansible/roles/baremetal/tasks/install.yml
Ethan Lynn 282afeafa3 Become root when executing task "Set firewall default policy"
Add missing "become: True"

Change-Id: I22b9a44fa3e5d147f487e2e24f3f0a65484951ff
Closes-Bug: #1648370
2016-12-08 17:31:15 +08:00

83 lines
1.9 KiB
YAML

---
- name: Update apt cache
command: apt-get update
become: True
when: ansible_os_family == 'Debian'
- name: Set firewall default policy
become: True
ufw: state=disabled policy=allow
when: ansible_os_family == 'Debian'
- name: Check if firewalld is installed
command: rpm -q firewalld
register: firewalld_check
failed_when: firewalld_check.rc > 1
when: ansible_os_family == 'RedHat'
- name: Disable firewalld
become: True
service:
name: "{{ item }}"
enabled: false
state: stopped
with_items:
- firewalld
when:
- ansible_os_family == 'RedHat'
- firewalld_check.rc == 0
- name: Install apt packages
package: name={{item}} state=present
become: True
with_items: "{{ debian_pkg_install }}"
when: ansible_os_family == 'Debian'
- name: Install wily kernel
package: name=linux-generic-lts-wily state=latest
register: kernel_updated
become: True
when:
- ansible_distribution|lower == "ubuntu" | bool
- ansible_distribution_release|lower == "trusty" | bool
- name: Set reboot required
set_fact:
reboot_required: True
when:
- kernel_updated is defined
- kernel_updated.changed
- name: Install deltarpm packages
package: name={{item}} state=installed
become: True
with_items:
- deltarpm
when: ansible_os_family == 'RedHat'
- name: Install yum packages
package: name={{item}} state=present
become: True
with_items: "{{ redhat_pkg_install }}"
when: ansible_os_family == 'RedHat'
- name: Install pip
easy_install: name=pip
become: True
- name: Install docker-py
pip: name=docker-py state=latest
become: True
- name: Remove packages
package: name={{item}} state=absent
with_items: "{{ ubuntu_pkg_removals }}"
become: True
when: ansible_distribution|lower == "ubuntu" | bool
- name: Remove packages
package: name={{item}} state=absent
with_items: "{{ redhat_pkg_removals }}"
become: True
when: ansible_os_family == 'RedHat'