Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
169 lines (143 sloc) 4.14 KB
---
- name: Install pip
become: True
yum:
name: python-pip
- name: clone kolla-ansible repository
git:
repo: https://github.com/openstack/kolla-ansible
dest: "{{ tmp_dir }}/kolla-ansible"
- name: Install kolla-ansible
become: True
pip:
name: "file://{{ tmp_dir }}/kolla-ansible"
- name: Make sure /etc/kolla exists
become: True
file:
path: "/etc/kolla"
state: directory
- name: Copy the configuration files globals.yml and passwords.yml to /etc directory
become: True
copy:
dest: "/etc/kolla/{{ item }}"
remote_src: true
src: "{{ tmp_dir }}/kolla-ansible/etc/kolla/{{ item }}"
with_items:
- globals.yml
- passwords.yml
- name: Override globals.yml options
become: True
lineinfile:
path: /etc/kolla/globals.yml
regexp: "{{ item.key }}:"
line: "{{ item.key }}: \"{{ item.value }}\""
create: yes
state: present
with_dict: "{{ globals_override }}"
- include: workaround_1727793.yml
when: bug_1727793 | bool
- name: Generate random passwords
become: True
command: kolla-genpwd
- name: Override passwords
become: True
lineinfile:
path: /etc/kolla/passwords.yml
regexp: "{{ item.key }}"
line: "{{ item.key }}: {{ item.value }}"
with_dict: "{{ password_overrides }}"
when: password_overrides is defined
- name: Copy multinode inventory file
copy:
src: "/usr/share/kolla-ansible/ansible/inventory/multinode"
remote_src: true
dest: "{{ kolla_node_home_dir }}/multinode"
- name: Update inventory file
lineinfile:
path: "{{ kolla_node_home_dir }}/multinode"
regexp: "^{{ item.key }}"
line: "{{ item.value }}"
with_dict: "{{ inventory_override }}"
- name: Add quagga to the inventory file
blockinfile:
path: "{{ kolla_node_home_dir }}/multinode"
block: |
[quagga:children]
network
- name: Create ansible.cfg file
blockinfile:
path: "{{ kolla_node_home_dir }}/ansible.cfg"
create: yes
block: |
[defaults]
remote_user = centos
[privilege_escalation]
become = True
- name: Create thrift-quagga directory structure
become: True
file:
path: "/usr/share/kolla-ansible/ansible/roles/thrift-quagga/{{ item.name }}"
state: directory
with_items: "{{ quagga_files }}"
when: quagga_files is defined
- name: Add thrift-quagga role files
become: True
copy:
src: "./files/quagga-{{ item.0.name }}-{{ item.1 }}"
dest: "/usr/share/kolla-ansible/ansible/roles/thrift-quagga/{{ item.0.name }}/{{ item.1 }}"
with_subelements:
- "{{ quagga_files }}"
- files
when: quagga_files is defined
- name: Add thrift-quagga role to site.yml
become: True
blockinfile:
path: "/usr/share/kolla-ansible/ansible/site.yml"
block: |
- name: Apply quagga role
gather_facts: false
hosts: quagga
roles:
- { role: thrift-quagga,
when: enable_opendaylight | bool,
tags: thrift-quagga }
when: quagga_files is defined
- include: start_ovs.yml
when: override_start_ovs | bool
- include: odl-latest-override.yml
when: odl_latest_enabled | bool
- name: update config owner user and group
become: True
lineinfile:
path: "/usr/share/kolla-ansible/ansible/group_vars/all.yml"
regexp: "{{ item.key }}:"
line: "{{ item.key }}: \"{{ item.value }}\""
create: yes
state: present
with_dict:
config_owner_user: centos
config_owner_group: centos
- name: Kolla prechecks
command: "kolla-ansible prechecks -i {{ kolla_node_home_dir }}/multinode"
environment:
ANSIBLE_HOST_KEY_CHECKING: False
- name: Kolla deploy
command: "kolla-ansible deploy -i {{ kolla_node_home_dir }}/multinode"
environment:
ANSIBLE_HOST_KEY_CHECKING: False
- name: Kolla post-deploy
become: True
command: "kolla-ansible post-deploy"
- name: copy bootstrap file
copy:
src: "./files/init.sh"
dest: "{{ kolla_node_home_dir }}/init.sh"
mode: u+rwx
- name: Update RC file with ODL variables
become: True
lineinfile:
path: "/etc/kolla/admin-openrc.sh"
line: "{{ item }}"
with_items:
- "export ODL_URL='http://192.168.133.100:8181/restconf'"
- "export CT_JSON=\"Content-Type: application/json\""