Support Kolla install from source

We need to make some downstream changes to Kolla currently, so let's install from source
rather than patching.
This commit is contained in:
Mark Goddard 2017-02-16 10:44:27 +00:00
parent b654a70e65
commit a082bd2446
16 changed files with 83 additions and 143 deletions

View File

@ -9,3 +9,6 @@ kayobe_config_path: "{{ lookup('env', 'KAYOBE_CONFIG_PATH') | default('/etc/kayo
# Path in which to cache downloaded images.
image_cache_path: "{{ ansible_user_dir ~ '/kayobe-image-cache' }}"
# Path on which to checkout source code repositories.
source_checkout_path: "{{ ansible_user_dir ~ '/kayobe-source' }}"

View File

@ -1,4 +1,17 @@
---
###############################################################################
# Kolla installation.
# Type of Kolla control installation. One of 'binary' or 'source'.
kolla_ctl_install_type: source
# URL of Kolla source code repository if type is 'source'.
kolla_source_url: "https://github.com/stackhpc/kolla"
# Version (branch, tag, etc.) of Kolla source code repository if type is
# 'source'.
kolla_source_version: "stackhpc-{{ kolla_openstack_release }}"
###############################################################################
# Kolla configuration.

View File

@ -1,10 +0,0 @@
--- /usr/share/kolla/ansible/roles/baremetal/templates/docker_yum_repo.j2.old 2017-01-10 16:21:05.305626808 -0500
+++ /usr/share/kolla/ansible/roles/baremetal/templates/docker_yum_repo.j2 2017-01-10 16:21:09.216645923 -0500
@@ -1,6 +1,6 @@
[docker-repo]
name=Docker main Repository
-baseurl={{docker_yum_url}}/repo/main/{{ansible_distribution|lower}}/{{ansible_distribution_major_version|lower}}
+baseurl={{docker_yum_url}}/repo/main/{% if ansible_distribution == 'RedHat' %}centos{% else %}{{ansible_distribution|lower}}{% endif %}/{{ansible_distribution_major_version|lower}}
enabled=1
gpgcheck=1
gpgkey={{docker_yum_url}}/gpg

View File

@ -1,27 +0,0 @@
--- /usr/share/kolla/ansible/roles/baremetal/tasks/pre-install.yml.old 2017-01-06 17:23:12.444746830 +0000
+++ /usr/share/kolla/ansible/roles/baremetal/tasks/pre-install.yml 2017-01-06 17:22:27.864278879 +0000
@@ -28,6 +28,7 @@
{% 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
- name: ensure sudo group is present
@@ -126,7 +127,7 @@
recurse: yes
owner: kolla
group: kolla
- mode: 755
+ mode: 0755
become: True
when: create_kolla_user | bool == True
@@ -135,6 +136,6 @@
path: /etc/kolla
state: directory
recurse: yes
- mode: 666
+ mode: 0666
become: True
when: create_kolla_user | bool == False

View File

@ -1,11 +0,0 @@
--- /usr/share/kolla/ansible/roles/ironic/templates/ironic-api.json.j2.old 2017-01-06 13:56:52.881061188 +0000
+++ /usr/share/kolla/ansible/roles/ironic/templates/ironic-api.json.j2 2017-01-06 14:00:21.757338271 +0000
@@ -10,7 +10,7 @@
],
"permissions": [
{
- "path": "/var/log/kolla/ironic"
+ "path": "/var/log/kolla/ironic",
"owner": "ironic:ironic",
"recurse": true
}

View File

@ -1,11 +0,0 @@
--- /usr/share/kolla/ansible/roles/ironic/templates/ironic-conductor.json.j2.old 2017-01-06 14:28:35.048365453 +0000
+++ /usr/share/kolla/ansible/roles/ironic/templates/ironic-conductor.json.j2 2017-01-06 14:28:44.858467071 +0000
@@ -20,7 +20,7 @@
"recurse": true
},
{
- "path": "/tftpboot"
+ "path": "/tftpboot",
"owner": "ironic:ironic",
"recurse": true
}

View File

@ -1,11 +0,0 @@
--- ansible/kolla-venv/bin/kolla-ansible.orig 2017-01-29 21:20:29.189225104 +0000
+++ ansible/kolla-venv/bin/kolla-ansible 2017-01-31 16:31:07.203695865 +0000
@@ -9,6 +9,8 @@
BASEDIR=/usr/share/kolla
elif [[ ${dir_name} == "/usr/local/bin" ]]; then
BASEDIR=/usr/local/share/kolla
+ elif [[ ${dir_name} == "${VIRTUAL_ENV}/bin" ]]; then
+ BASEDIR="${VIRTUAL_ENV}/share/kolla"
else
BASEDIR="$(dirname ${dir_name})"
fi

View File

@ -1,11 +0,0 @@
--- ansible/kolla-venv/share/kolla/ansible/roles/prechecks/tasks/port_checks.yml.orig 2017-01-31 16:26:26.021463306 +0000
+++ ansible/kolla-venv/share/kolla/ansible/roles/prechecks/tasks/port_checks.yml 2017-01-31 16:27:22.045711530 +0000
@@ -601,7 +601,7 @@
changed_when: false
failed_when: "'169.254.' not in kolla_internal_vip_address and \
kolla_internal_vip_address | ipaddr(ip_addr_output.stdout.split()[3]) is none"
- when: enable_haproxy | bool
+ when: false
- name: Checking the network_interface is present
fail: "msg='Please check the network_interface property - interface {{ network_interface }} not found'"

View File

@ -1,34 +0,0 @@
---
- name: Ensure the Kolla configuration directores exist
file:
path: "{{ item }}"
state: directory
mode: 0755
become: True
with_items:
- "{{ kolla_config_path }}/inventory"
- "{{ kolla_node_custom_config_path }}"
- name: Ensure the Kolla configuration files exist
template:
src: "{{ item.src }}"
dest: "{{ kolla_config_path }}/{{ item.dest }}"
mode: 0644
become: True
with_items:
- { src: seed.j2, dest: inventory/seed }
- { src: overcloud.j2, dest: inventory/overcloud }
- { src: globals.yml.j2, dest: globals.yml }
- name: Check whether the Kolla passwords file exists
stat:
path: "{{ kolla_config_path }}/passwords.yml"
register: kolla_passwords_stat
- name: Generate Kolla passwords
shell: >
cp {{ kolla_install_dir }}/etc_examples/kolla/passwords.yml {{ kolla_config_path }}/passwords.yml.generated
&& {{ kolla_venv }}/bin/kolla-genpwd -p {{ kolla_config_path }}/passwords.yml.generated
&& mv {{ kolla_config_path }}/passwords.yml.generated {{ kolla_config_path }}/passwords.yml
become: True
when: not kolla_passwords_stat.stat.exists

View File

@ -1,19 +0,0 @@
---
- name: Ensure Kolla patches are applied
patch:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
become: True
with_items:
- src: baremetal-docker_yum_repo.j2.patch
dest: "{{ kolla_install_dir }}/ansible/roles/baremetal/templates/docker_yum_repo.j2"
- src: baremetal-pre-install.yml.patch
dest: "{{ kolla_install_dir }}/ansible/roles/baremetal/tasks/pre-install.yml"
- src: ironic-api.json.j2.patch
dest: "{{ kolla_install_dir }}/ansible/roles/ironic/templates/ironic-api.json.j2"
- src: ironic-conductor.json.j2.patch
dest: "{{ kolla_install_dir }}/ansible/roles/ironic/templates/ironic-conductor.json.j2"
- src: prechecks-port_checks.yml.patch
dest: "{{ kolla_install_dir }}/ansible/roles/prechecks/tasks/port_checks.yml"
- src: kolla-ansible.patch
dest: "{{ kolla_venv }}/bin/kolla-ansible"

View File

@ -1,3 +1,34 @@
---
- include: install.yml
- include: config.yml
- name: Ensure the Kolla configuration directores exist
file:
path: "{{ item }}"
state: directory
mode: 0755
become: True
with_items:
- "{{ kolla_config_path }}/inventory"
- "{{ kolla_node_custom_config_path }}"
- name: Ensure the Kolla configuration files exist
template:
src: "{{ item.src }}"
dest: "{{ kolla_config_path }}/{{ item.dest }}"
mode: 0644
become: True
with_items:
- { src: seed.j2, dest: inventory/seed }
- { src: overcloud.j2, dest: inventory/overcloud }
- { src: globals.yml.j2, dest: globals.yml }
- name: Check whether the Kolla passwords file exists
stat:
path: "{{ kolla_config_path }}/passwords.yml"
register: kolla_passwords_stat
- name: Generate Kolla passwords
shell: >
cp {{ kolla_install_dir }}/etc_examples/kolla/passwords.yml {{ kolla_config_path }}/passwords.yml.generated
&& {{ kolla_venv }}/bin/kolla-genpwd -p {{ kolla_config_path }}/passwords.yml.generated
&& mv {{ kolla_config_path }}/passwords.yml.generated {{ kolla_config_path }}/passwords.yml
become: True
when: not kolla_passwords_stat.stat.exists

View File

@ -3,8 +3,6 @@
file:
path: "{{ kolla_node_custom_config_path }}/{{ item.name }}"
state: directory
owner: kolla
group: kolla
mode: 0755
become: True
with_items:
@ -15,8 +13,6 @@
template:
src: "{{ item.src }}"
dest: "{{ kolla_node_custom_config_path }}/{{ item.dest }}"
owner: kolla
group: kolla
mode: 0644
become: True
with_items:

View File

@ -21,16 +21,31 @@
with_items:
- { name: pip }
- name: Ensure Kolla source code checkout exists
git:
repo: "{{ kolla_source_url }}"
dest: "{{ source_checkout_path }}/kolla"
version: "{{ kolla_source_version }}"
when: "{{ kolla_ctl_install_type == 'source' }}"
- name: Ensure required Python packages are installed
pip:
name: "{{ item.name }}"
version: "{{ item.version }}"
version: "{{ item.version | default(omit) }}"
state: present
virtualenv: "{{ kolla_venv }}"
with_items:
- { name: kolla, version: "{{ kolla_openstack_release }}" }
# Intall Kolla from source.
- name: "{{ source_checkout_path }}/kolla"
install: "{{ kolla_ctl_install_type == 'source' }}"
# Intall Kolla from PyPI.
- name: "kolla"
version: "{{ kolla_openstack_release }}"
install: "{{ kolla_ctl_install_type == 'binary' }}"
# Required for kolla-genpwd.
- { name: PyYAML, version: "3.12" }
- name: PyYAML
version: "3.12"
when: "{{ item.install | default(True) | bool }}"
- name: Ensure the Kolla configuration directores exist
file:

View File

@ -10,6 +10,9 @@
# Path in which to cache downloaded images.
#image_cache_path:
# Path on which to checkout source code repositories.
#source_checkout_path:
###############################################################################
# Dummy variable to allow Ansible to accept this file.
workaround_ansible_issue_8743: yes

View File

@ -1,6 +1,19 @@
---
# Kayobe Kolla configuration.
###############################################################################
# Kolla installation.
# Type of Kolla control installation. One of 'binary' or 'source'.
#kolla_ctl_install_type:
# URL of Kolla source code repository if type is 'source'.
#kolla_source_url:
# Version (branch, tag, etc.) of Kolla source code repository if type is
# 'source'.
#kolla_source_version:
###############################################################################
# Kolla configuration.