Comments (5)
Thanks @fosterseth and @AlanCoding for your response...
Is there any way for me to modify the cloned repo to add this in a quick fix ?
Like the invocation of the constrcuted inventory sync job - anything at all ?
Would be fantastic, because at the moment, we're just pasting a massive comma seperate list into the Limit of the job ...
cheers, happy to spend time to investigate if you point me in the right direction :)
What would be ideal - and I'm not really sure why this isn't "a thing" - is using the extra vars -e
while building a dynamic inventory... bypassing the constructed inventory
# MySQL Dynamic Inventory
# https://github.com/j-oss2023/mysql-dynamic-inventory # Custom Dynamic Plugin
#
# Required columns:
# 'inventory_group', 'inventory_hostname'
#
# TLDR:
# Besides the required columns, each column will be assigned
# as an ansible hostvar dynamically.
plugin: mysql-dynamic-inventory
db_host: "{{secrets.db_host}}"
db_user: "{{secrets.db_user}}"
db_pass: "{{secrets.db_pass}}"
db_name: "{{secrets.db_name}}"
db_query: |
SELECT
'motorvehicle_co' as inventory_group,
host as inventory_hostname,
address as ansible_host,
account as customer from dealerships
WHERE customer = "{{target_customer}}"
Then simply calling the playbook like so
ansible-playbook -i per_customer_mysql.yml setup.yml -e 'target_customer="Ferrari"'
That would rock!
But I've read a lot of places that it's simply unattainable ...
Maybe i'm just coming at this at the wrong angle and it's giving me tunnel vision π
But I wish this was possible...
from awx.
Please also see:
from awx.
@AlanCoding is AWX expected to support the use_extra_vars: True
declaration?
from awx.
This is a valid point. The problem is that it runs ansible-inventory
to save the content to the database before it is used in a job (ansible-playbook
) at which time it is re-serialized from the database. There's not a 1-to-1 mapping of constructed inventories to jobs, so there's not a way to make this feature work without breaking other things. Maybe there's some envelope of parameters where it is set to update on launch and the plugin specifics this parameter, it would be okay to apply the job's extra_vars to the constructed inventory.
from awx.
Thanks @fosterseth and @AlanCoding for your response...
Is there any way for me to modify the cloned repo to add this in a quick fix ? Like the invocation of the constrcuted inventory sync job - anything at all ?
Would be fantastic, because at the moment, we're just pasting a massive comma seperate list into the Limit of the job ...
cheers, happy to spend time to investigate if you point me in the right direction :)
What would be ideal - and I'm not really sure why this isn't "a thing" - is using the extra vars
-e
while building a dynamic inventory... bypassing the constructed inventory# MySQL Dynamic Inventory # https://github.com/j-oss2023/mysql-dynamic-inventory # Custom Dynamic Plugin # # Required columns: # 'inventory_group', 'inventory_hostname' # # TLDR: # Besides the required columns, each column will be assigned # as an ansible hostvar dynamically. plugin: mysql-dynamic-inventory db_host: "{{secrets.db_host}}" db_user: "{{secrets.db_user}}" db_pass: "{{secrets.db_pass}}" db_name: "{{secrets.db_name}}" db_query: | SELECT 'motorvehicle_co' as inventory_group, host as inventory_hostname, address as ansible_host, account as customer from dealerships WHERE customer = "{{target_customer}}"Then simply calling the playbook like so
ansible-playbook -i per_customer_mysql.yml setup.yml -e 'target_customer="Ferrari"'
That would rock! But I've read a lot of places that it's simply unattainable ...
Maybe i'm just coming at this at the wrong angle and it's giving me tunnel vision π But I wish this was possible...
I've fixed the plugin,
#14868 (comment)
which now correctly templates vars in the inventory config file... so that is working now with ansible cli ...
but still - AWX bug fix / feature enhancment is needed to allow it to read those extra vars inside AWX...
from awx.
Related Issues (20)
- `make VERSION` fails outside the virtual environment
- Feature to define Job template webhook key manually
- Suggested fix for SAML authentication
- invalid permissions on postgres pod HOT 5
- AWX 24.3.1 api/v2/workflow_job_templates/<id>/access_list/ API returns 500 HOT 1
- unable to add any collection HOT 1
- Improve User Feedback and Terminology Consistency in Ansible AWX UI
- jobs are failing on awx.main.commands.run_callback_receiver Database Error HOT 3
- HTTP code 404 when using named url HOT 1
- Duplicate metrics causing issue with prometheus >= 2.52.0 HOT 1
- AWX Community Meeting - June 2024 HOT 1
- Restore is not working as expected | need restore docs
- Tech Preview UI displaying "password" survey type value in extra vars "Review" page
- job api is not support POST but can find βCreate a job β in api doc HOT 1
- The running ansible process received a shutdown signal.
- AWX not able to delete the worker pods after finished running HOT 3
- awx.awx collection: support for 'Terraform State' inventory source HOT 3
- Add Kube credentials in the inventory source picker
- Tech Preview UI displaying "Create question" survey button greyed out
- Docker Documentation Not Working HOT 2
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 awx.