Ansible gave "Error fetching server list on envvars:RegionOne" error

Hello team,

warm wishes to all the Ansible team.

I got the below error while try to create the provisioning ansible in openstack.

I searched for so many websites but never found any solution. Please help me to come out of the error and its my high priority task on Ansible.

Thank you.

and this is my playbook:

Hi,

The issue is not related to your playbook. The error is from openstack side looks like you are missing domain in environment varibales. Try adding domain in your your openrc file and run the playbook in verbose mode.

Also it looks like your system is trying to connect to region two and in Playbook is configured with Region one. As you can see in error message the error is for region2. Can you cross check the env variables?

Regards,
Amarjeet

Hello Raja,

Thanks for your reply.

1.) Here Domain means is that the Openstack OS_AUTH_URL=https://identityHost:portNumber/v2.0 Right?

2.) Yes, I cross check about error and uploaded image. For both RegionOne and RegionTwo, I got the same error.

Please reply ASAP.

Thank you in advance.

I gave

export OS_USER_DOMAIN_NAME=default

in openrc.sh and Is this one you mentioned above?

Hi,

Looks like you misunderstood my previous mail, there is no need to edit your openrc file. The OS_server module can load the login details from openrc file. Hard coding openstack logins in playbook is not a recommended practice. You can use the sample snippet given below to create an instance in openstack using ansible and assign floating IP address.

Hello Amarjeet Raja,

I worked out on your above example with again and again by changing the openstack integration with ansible.
But i got the below error.

“Problem with auth parameters”

my original code :

#create a new instance in HP Cloud AE1 region availability zone az2 and
# automatically assigns a floating IP
- name: launch a compute instance
hosts: localhost
sudo: yes
tasks:
# - name: echo PATH into bashrc
# action: lineinfile dest=~/.bash_profile line=‘export user_domain_name=default’ insertafter=‘EOF’ regexp=‘export user_domain_name.*’ state=present

- name: launch an instance
os_server:
state: present
auth:
auth_url: http://192.168.8.25:5000/v3/
username: admin
password: MiracleIT
# password: admin
project_name: admin
register: catalog
auth_type: password
name: vm1
region_name: RegionOne
availability_zone: nova
image: 913ef163-e2aa-4161-85d4-16a9924abfa1
key_name: ubuntutestkeypair1
timeout: 200
flavor: m1.medium
security_groups: default
auto_ip: yes
- debug: var=catalog

I attached the error. will you please suggest me any guide to do ansible integration with Openstack,

Thank you.