Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
=======================================================
Use RHEL6 for OCP master and worker nodes
[vkommadi@localhost copy-ssh-keys]$ ssh root@ansible1
Last login: Mon May 20 00:51:23 2019 from ovpn-116-142.sin2.redhat.com
[root@gprfc046 ~]# ssh master
Last login: Fri May 17 09:22:19 2019 from 172.16.0.1
[root@openshift-master-0 ~]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.6 (Maipo)
[root@openshift-master-0 ~]# ls /etc/yum.repos.d/
CentOS-OpenShift-Origin311.repo ose-v3.repo rhos-release.repo rhos-release-rhel-7.6.repo
[root@openshift-master-0 ~]#
======================================================
1) repo setup
copy rhos-release rpm
yum install -y rhos-release-latest.noarch.rpm
rhos-release 14-director -p passed_phase2
yum update -y; reboot
2) yum install git ansible tmux -y
git clone https://github.com/smalleni/sahasra
3) let infrared use nodes topology from ./plugins/virsh/defaults/topology/nodes
create ssh-key and add it to authorized_keys
In undercloud /home/stack create cloud.yml with below content i.e
(undercloud) [stack@undercloud-0 ~]$ cat /home/stack/clouds.yml
clouds:
undercloud:
auth:
username: admin
password: o9MoCYyS7JK7jHG2Y2Bp3Gzmi
project_name: admin
auth_url: https://192.168.24.2:13000/
user_domain_name: Default
project_domain_name: Default
Note: I didn't install openstack ansible modules explicitly in undercloud or ansbile (i.e infrared) host.
Ansible playbook in infrared(ansbile) node os_ports.yml
---
- hosts: localhost
remote_user: stack
tasks:
- name: os get ports
os_port_facts:
cloud: undercloud
port: 053e8a57-70dd-4e72-bc1f-4eb35b052b38
delegate_to: undercloud-0
I ran it like
(undercloud) (.venv) [stack@gprfc044 ansible]$ ansible-playbook -vvv os_ports.yml
output is
ok: [localhost -> undercloud-0] => {
"ansible_facts": {
"openstack_ports": [
{
"admin_state_up": true,
"allowed_address_pairs": [],
"binding:host_id": "",
"binding:profile": {},
"binding:vif_details": {},
"binding:vif_type": "unbound",
"binding:vnic_type": "normal",
"created_at": "2019-04-27T13:34:40Z",
"description": "",
"device_id": "",
"device_owner": "",
"extra_dhcp_opts": [],
"fixed_ips": [
{
"ip_address": "10.0.0.115",
"subnet_id": "353133c5-8f0a-4f8a-afc3-cc20119bb999"
}
],
"id": "053e8a57-70dd-4e72-bc1f-4eb35b052b38",
"ip_allocation": "immediate",
"mac_address": "fa:16:3e:c5:08:0c",
"name": "controller-0_External",
"network_id": "470e0e56-61d5-48be-842f-4d185e7ffec1",
"port_security_enabled": true,
"project_id": "85e7470bcef949f4a560914f49beb5c8",
"revision_number": 1,
"security_groups": [
"2e312583-c8cd-40cb-a015-7f78fc895042"
],
"status": "DOWN",
"tags": [],
"tenant_id": "85e7470bcef949f4a560914f49beb5c8",
"updated_at": "2019-04-27T13:34:41Z"
}
]
},
"changed": false,
"invocation": {
"module_args": {
"api_timeout": null,
"auth": null,
"auth_type": null,
"availability_zone": null,
"cacert": null,
"cert": null,
"filters": null,
"interface": "public",
"key": null,
"port": "053e8a57-70dd-4e72-bc1f-4eb35b052b38",
"region_name": null,
"timeout": 180,
"verify": null,
"wait": true
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.