fix osp-13 issues

1.switch to get-pip.py script to install pip on undercloud
2.pip the python-openstackclient at 3.11.0 for python2
3.make the tripleo based hostfile script as default choice

Change-Id: Idc90832ee9372954e4e05ce36a0a00886a427bce
This commit is contained in:
Masco Kaliyamoorthy 2021-06-01 14:07:08 +05:30
parent bdf3de9010
commit fda773c682
4 changed files with 40 additions and 14 deletions

View File

@ -52,3 +52,11 @@ fi
sed -i '1iBrowbeat:\n hosts:\n undercloud: {}' ${out_file}
sed -i '$aStockpile:\n hosts:\n undercloud: {}' ${out_file}
# Copy heat-admin key so we can use jumpbox
echo ""
echo "---------------------------"
echo "Copying heat-admin key to local machine for use with ssh config file"
echo "---------------------------"
echo ""
scp -o "UserKnownHostsFile /dev/null" -o "StrictHostKeyChecking no" "${user}@${tripleo_ip_address}":/home/${user}/.ssh/id_rsa heat-admin-id_rsa

View File

@ -42,9 +42,17 @@
when: ansible_distribution_major_version == '8'
- name: Install pip
easy_install:
name: pip
become: true
block:
- name: get the pip installer
get_url:
validate_certs: no
url: "https://bootstrap.pypa.io/pip/2.7/get-pip.py"
dest: "/tmp/get-pip.py"
force: yes
- name: run pip installer
shell: python /tmp/get-pip.py
when: ansible_distribution_major_version < '8'
- name: Update virtualenv and setuptools
@ -95,23 +103,32 @@
path: "{{ browbeat_path }}/ansible/hosts"
register: hosts_file_exists
- debug: msg="Hosts file is already generated."
when: hosts_file_exists.stat.exists and hosts_file_exists.stat.isreg
- name: Determine if generate_tripleo_inventory has been run
stat:
path: "{{ browbeat_path }}/ansible/hosts.yml"
register: hosts_yml_file_exists
- name: set either of inventory file exists
set_fact:
inventry_file: "{{ (hosts_file_exists.stat.exists and hosts_file_exists.stat.isreg) or (hosts_yml_file_exists.stat.exists and hosts_yml_file_exists.stat.isreg) }}"
- debug: msg="Hosts file is already generated. {{ inventry_file }}"
when: inventry_file
- name: Generate hosts and ssh-config on Browbeat Machine - Default(stack)
shell: . {{ home_dir }}/stackrc; {{ browbeat_path }}/ansible/generate_tripleo_hostfile.sh -t localhost --user stack
when: tripleo and (not hosts_file_exists.stat.exists or not hosts_file_exists.stat.isreg) and ansible_user!= "zuul"
shell: . {{ home_dir }}/stackrc; {{ browbeat_path }}/ansible/generate_tripleo_inventory.sh -l --user stack
when: tripleo and (not inventry_file) and ansible_user!= "zuul"
- name: Generate hosts and ssh-config on Browbeat Machine - Zuul
shell: . {{ home_dir }}/stackrc; {{ browbeat_path }}/ansible/generate_tripleo_hostfile.sh -t localhost --user zuul
when: tripleo and (not hosts_file_exists.stat.exists or not hosts_file_exists.stat.isreg) and ansible_user== "zuul"
shell: . {{ home_dir }}/stackrc; {{ browbeat_path }}/ansible/generate_tripleo_inventory.sh -l --user zuul
when: tripleo and (not inventry_file) and ansible_user== "zuul"
- name: Move files to correct location
command: mv {{ home_dir }}/{{item}} {{ browbeat_path }}/ansible/{{item}}
command: mv {{item}} {{ browbeat_path }}/ansible/{{item}}
with_items:
- hosts
- hosts.yml
- heat-admin-id_rsa
when: "(tripleo and (not hosts_file_exists.stat.exists or not hosts_file_exists.stat.isreg))"
when: "(tripleo and (not inventry_file))"
- name: Install requirements.txt into browbeat-venv
pip:

View File

@ -8,7 +8,7 @@ browbeat:
# rerun_type: complete
rerun_type: iteration
ansible:
hosts: ansible/hosts
hosts: ansible/hosts.yml
metadata_playbook: ansible/gather/stockpile.yml
logging_playbook: ansible/common_logging/browbeat_logging.yml
ssh_config: ansible/ssh-config

View File

@ -7,7 +7,8 @@ pyrsistent>=0.17.0;python_version>='3'
grafyaml>=0.0.7
openstacksdk
python-dateutil>=2.4.2
python-openstackclient>=3.11.0
python-openstackclient==3.11.0;python_version<'3'
python-openstackclient>=3.11.0;python_version>='3'
pykwalify==1.7.0;python_version<'3'
pykwalify>=1.8.0;python_version>='3'