Update the file format for baremetal

Change-Id: I1e90b0aeebaa0db0b91370eccfc0b707d9668752
This commit is contained in:
caoyuan 2017-02-24 17:45:08 +08:00
parent 0883d34d4a
commit c39e896e7c
4 changed files with 39 additions and 37 deletions

View File

@ -1,4 +1,6 @@
---
- include: pre-install.yml
- include: install.yml
- include: post-install.yml

View File

@ -24,8 +24,8 @@
with_items:
- firewalld
when:
- ansible_os_family == 'RedHat'
- firewalld_check.rc == 0
- ansible_os_family == 'RedHat'
- firewalld_check.rc == 0
- name: Install apt packages
package: name={{item}} state=present
@ -38,21 +38,21 @@
register: kernel_updated
become: True
when:
- ansible_distribution|lower == "ubuntu" | bool
- ansible_distribution_release|lower == "trusty" | bool
- 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
- kernel_updated is defined
- kernel_updated.changed
- name: Install deltarpm packages
package: name={{item}} state=installed
become: True
with_items:
- deltarpm
- deltarpm
when: ansible_os_family == 'RedHat'
- name: Install yum packages

View File

@ -1,9 +1,9 @@
---
- name: Ensure docker service directory exists
file:
path=/etc/systemd/system/docker.service.d
state=directory
recurse=yes
path=/etc/systemd/system/docker.service.d
state=directory
recurse=yes
become: True
when: (ansible_distribution == "Ubuntu" and ansible_distribution_major_version > "14") or
(ansible_os_family == "RedHat") or (ansible_distribution == "Debian")
@ -11,8 +11,8 @@
- name: Configure docker service
become: True
template:
src=docker_systemd_service.j2
dest=/etc/systemd/system/docker.service.d/kolla.conf
src=docker_systemd_service.j2
dest=/etc/systemd/system/docker.service.d/kolla.conf
when: (ansible_distribution == "Ubuntu" and ansible_distribution_major_version > "14") or
(ansible_os_family == "RedHat") or (ansible_distribution == "Debian")
@ -25,8 +25,8 @@
- name: Configure docker service
become: True
template:
src=docker_defaults.j2
dest=/etc/default/docker
src=docker_defaults.j2
dest=/etc/default/docker
when: (ansible_distribution == "Ubuntu" and ansible_distribution_major_version < "15")
- name: Docker mount shared
@ -48,38 +48,38 @@
- name: Create docker group
group:
name: docker
name: docker
become: True
- name: Add kolla user to docker group
user:
name: kolla
append: yes
groups: docker
name: kolla
append: yes
groups: docker
become: True
when: create_kolla_user | bool
- name: Start docker
service:
name: docker
state: started
name: docker
state: started
become: True
- name: Restart docker
service:
name: docker
state: restarted
name: docker
state: restarted
become: True
- name: Enable docker
service:
name: docker
enabled: yes
name: docker
enabled: yes
become: True
- name: Reboot
command: reboot -f
become: True
when:
- reboot_required is defined
- reboot_required | bool
- reboot_required is defined
- reboot_required | bool

View File

@ -18,11 +18,11 @@
- name: Generate /etc/hosts for all of the nodes
blockinfile:
dest: /etc/hosts
marker: "# {mark} ANSIBLE GENERATED HOSTS"
block: |
{% for host in groups['all'] %}
{{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }} {{ hostvars[host]['ansible_hostname'] }}
dest: /etc/hosts
marker: "# {mark} ANSIBLE GENERATED HOSTS"
block: |
{% for host in groups['all'] %}
{{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }} {{ hostvars[host]['ansible_hostname'] }}
{% endfor %}
become: True
when: customize_etc_hosts | bool
@ -70,10 +70,10 @@
package: name={{item}} state=latest
become: True
with_items:
- ca-certificates
- apt-transport-https
- ca-certificates
- apt-transport-https
when:
- ansible_os_family == 'Debian'
- ansible_os_family == 'Debian'
- name: Ensure apt sources list directory exists
file: path=/etc/apt/sources.list.d state=directory recurse=yes
@ -94,8 +94,8 @@
state: present
become: True
when:
- ansible_os_family == 'Debian'
- ansible_distribution == 'Ubuntu'
- ansible_os_family == 'Debian'
- ansible_distribution == 'Ubuntu'
- name: Ensure yum repos directory exists
file: path=/etc/yum.repos.d/ state=directory recurse=yes