Comments (9)
I tried this without success
cat <<EOF > openstack/list_images1.yaml
---
- hosts: localhost
module_defaults:
group/openstack.cloud.openstack:
auth_type: "v3applicationcredential"
auth:
auth_url: "https://rhos-d.infra.prod.upshift.rdu2.redhat.com:13000/v3"
application_credential_id: "9c9....0deab6e8"
application_credential_secret: "Kfi444Nl-...BcnWB05i5X6orgdTjwhRQ1JYQ"
tasks:
- name: List images
openstack.cloud.image_info:
auth: "{{ override_defaults }}"
filters:
os_distro: "fedora"
register: image_info_result
- name: "Print Openstack output"
debug:
var: image_info_result
EOF
ansible-playbook openstack/list_images1.yaml
-->
fatal: [localhost]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: 'override_defaults' is undefined. 'override_defaults' is undefined
from k8s-infra.
This is how I implemented the v3applicationcredential
authentication, and it worked.
- name: List Fedora images
openstack.cloud.image_info:
auth_type: "v3applicationcredential"
auth:
auth_url: "https://rhos-d.infra.prod.upshift.rdu2.redhat.com:13000"
application_credential_id: "loremipsumdolorsitametconsecteturadipiscingelit"
application_credential_secret: "loremipsumdolorsitametconsecteturadipiscingelitseddoeiusmodtemporincididuntutlaboreetdoloremagnaaliqua"
properties:
os_distro: "fedora"
register: image_info_result
from k8s-infra.
This is how I implemented the
v3applicationcredential
authentication, and it worked.
That works for me too. This is not the question. The idea is to be able to declare one time the AUTH parameters and to inherit them within the different tasks.
from k8s-infra.
If you want to define a variable with the authentication information so it is reused you can also do this.
- name: "Set facts"
ansible.builtin.set_fact:
rhos_authentication_type: v3applicationcredential
rhos_authentication:
auth_url: "https://rhos-d.infra.prod.upshift.rdu2.redhat.com:13000"
application_credential_id: "loremipsumdolorsitametconsecteturadipiscingelit"
application_credential_secret: "loremipsumdolorsitametconsecteturadipiscingelitseddoeiusmodtemporincididuntutlaboreetdoloremagnaaliqua"
- name: List Fedora images
openstack.cloud.image_info:
auth_type: "{{ rhos_authentication_type }}"
auth: "{{ rhos_authentication }}"
properties:
os_distro: "fedora"
register: image_info_result
from k8s-infra.
If you want to define a variable with the authentication information so it is reused you can also do this.
What about this where we dont have to pass or override some auth parameters ?
- hosts: localhost
module_defaults:
group/openstack.cloud.openstack:
auth_type: "v3applicationcredential"
auth:
auth_url: "https://rhos-d.infra.prod.upshift.rdu2.redhat.com:13000/v3"
application_credential_id: "9c920....e8"
application_credential_secret: "Kfi4....hRQ1JYQ"
tasks:
- name: List images
openstack.cloud.image_info:
filters:
os_distro: "fedora"
register: image_info_result
from k8s-infra.
That can only be achieved either by using environment variables or using a named cloud.
From the Ansible docs:
Dictionary containing auth information as needed by the cloud’s auth plugin strategy.
For the default password plugin, this would contain auth_url, username, password,
project_name and any information about domains (for example, user_domain_name or
project_domain_name) if the cloud supports them. For other plugins, this param will
need to contain whatever parameters that auth plugin requires. This parameter is not
needed if a named cloud is provided or OpenStack OS_* environment variables are present.
IIUC, named cloud requires having a local clouds.yaml
file with the authentication information. Something like:
clouds:
cloud_name:
auth:
project_name: "XXXXXXXXXXXXXXXXXX"
username: "XXXXXXXXXXXXXXXXXX"
password: "XXXXXXXXXXXXXXXXXX"
user_domain_name: "XXXXXXXXXXXXXXXXXX"
project_domain_name: "XXXXXXXXXXXXXXXXXX"
auth_url: "XXXXXXXXXXXXXXXXXX"
region_name: "XXXXXXXXXXXXXXXXXX"
interface: "XXXXXXXXXXXXXXXXXX"
identity_api_version: 3
from k8s-infra.
That can only be achieved either by using environment variables or using a named cloud.
I dont follow you here. Where are you looking to use clouds.yaml fil ?
from k8s-infra.
I was checking for options where we don't need to pass or override the auth parameters on the playbook and roles, and those are the only 2 options I see.
from k8s-infra.
I was checking for options where we don't need to pass or override the auth parameters on the playbook and roles, and those are the only 2 options I see.
I vote to use as no override is needed, can be declared one time = init step, etc
module_defaults:
group/openstack.cloud.openstack:
...
from k8s-infra.
Related Issues (20)
- Creating a VM shouldn't require k8s_type or k8s_version parameters HOT 1
- Wrong command logged to delete a VM from inventory HOT 3
- Some parameters should become optional when we create a new VM on RHOS HOT 3
- Failed to connect to the host via ssh: no such identity: /Users/cmoullia/.ssh/id_rsa_snowdrop_openstack: No such file or directory HOT 3
- Remove information from the hosts file HOT 1
- Should we move the cloud_infra Ansible collection to it's own repository HOT 5
- kind.sh - invalid portMapping: port mapping with same listen address, port and protocol already configured: 0.0.0.0:0/TCP
- Support to patch/provide another kind config HOT 2
- Improper commands showed !
- Rename the RHOS test-adm-key
- Replace the Calico Operator based installation with the kubernetes manifests HOT 1
- Add support for floating_ip in the Ansible Inventory
- Check if community.hrobot ansible collection is required
- OCP installation
- ERROR! the role 'passstore/ansible_inventory' was not found HOT 3
- Support the parameter clusterOSImage for ocp openstack installation
- VM with Fedora-38-latest doesn't allow ssh
- Improve docs for OCP installation
- $HOME/.pyvirt/bin/python3.11: No such file or directory ... The following modules failed to execute: ansible.legacy.setup HOT 4
- Find a way to grab the new certificate generated by Lets'encrypt to update our cluster (or a cluster)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from k8s-infra.