awx | AWX provides a web-based user interface | Automation library
kandi X-RAY | awx Summary
kandi X-RAY | awx Summary
AWX provides a web-based user interface, REST API, and task engine built on top of Ansible. It is one of the upstream projects for Red Hat Ansible Automation Platform. To install AWX, please view the Install guide. To learn more about using AWX, and Tower, view the Tower docs site.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Make the admin data .
- Register authentication methods .
- Rebuild the ancestry list for a role .
- Update the model with the given pk
- Collect metrics .
- Gather analytics .
- Get field info .
- Validate survey spec data .
- Performs an update operation .
- Validate a PEM encoded PEM file .
awx Key Features
awx Examples and Code Snippets
{
"name": "Simple Survey",
"description": "Description of the simple survey",
"spec": [
{
"type": "text",
"question_name": "example question",
"question_description": "What is your favorite color?",
"variable":
{
"id": 1,
"type": "o_auth2_application",
"url": "/api/v2/applications/1/",
"related": {
"user": "/api/v2/users/1/",
"tokens": "/api/v2/applications/1/tokens/",
"activity_stream": "/api/v2/applications/1/activi
GET /api/v2/settings/github-team/
HTTP 200 OK
Allow: GET, PUT, PATCH, DELETE, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept
X-API-Node: tower
X-API-Query-Count: 6
X-API-Query-Time: 0.004s
X-API-Time: 0.026s
{
"SOCIAL_AUTH_GITHUB_TEAM
Community Discussions
Trending Discussions on awx
QUESTION
I'm new to ansible . I'm trying to use an existing playbook but deploy it to a different Azure account with seperate credentials but I'm running into some issues. I created a new credential via the AWX portal with my client_id, tenant_id, subscription_id and secret but I cant figure out how to get my playbook to pull this credential instead of the one its currently using.
My playbook authentication role authenticates like so
...ANSWER
Answered 2022-Mar-23 at 08:30Assuming your unencrypted "vault file" in your "secrets folder" looks like this:
QUESTION
I'm trying to deploy a JSON file as a template and configure the variables for it in a group_var. Here is how I have my ansible structured:
...ANSWER
Answered 2022-Mar-06 at 20:32So I figured out my own issue. One of the reasons this wasn't working is because the file name I had for the host yaml was different from what I defined in the host file. For example:
QUESTION
I use a plugin such as nginx in ansible playbook.
https://galaxy.ansible.com/nginxinc/nginx_core
On server I can use cli to install the roles and collections as
...ANSWER
Answered 2022-Mar-02 at 13:58In addition to @Zeitounator comment, you could also manually install your collection into a dedicated path (i.e into collections folder from awx directory)
If you use a requirements.yml file :
QUESTION
I have a playbook that is launched from AWX with machine credentials, ie. with ssh_user_A
. In this playbook, i need to perform a couple of tasks with another SSH user, ie. ssh_user_B
.
In terms of credentials, I have:
- machine credentials for
ssh_user_A
that are OK, I can do whatever I need - a public/private keys couple for
ssh_user_B
:- the public key is present on the remote host in the
~ssh_user_B/.ssh/authorized_keys
file - if I test this public/private key with a temp machine credentials (not possible in final target) and a dummy playbook or an ad-hoc module call, it works I can do whatever I need
- the public key is present on the remote host in the
I change the SSH user in the playbook with these instructions:
...ANSWER
Answered 2022-Mar-02 at 08:54I've made a lot of tests and found the problem: by default, to connect to the target hosts, Ansible uses the smart
connection plugin. In my case, the smart
plugin leads to the use of the native OpenSSH.
Forcing manually the use of the paramiko
connection plugin solves the problem, everything is OK (paramiko is a Python implementation of OpenSSH). Just need to add the instruction connection: paramiko
at the needed level:
QUESTION
AWX/Ansible Tower has it's own REST API service. From the below url structure i can get information about an in progress or finished workflow job:
...ANSWER
Answered 2022-Feb-04 at 14:41According the Ansible Tower API Reference Guide Workflow Jobs, by
Retriving a Workflow Job the status: (choice)
can have following values
QUESTION
I'm facing a problem when trying to get the id of one group in Ansible tower using a playbook and inside the playbook I am using the tower-cli command.
The problem is that when I get the output of this tower-cli command:
...ANSWER
Answered 2022-Jan-28 at 16:35This is because group_id.stdout
is a string representing a JSON, not a JSON.
You will have to pass it through the from_json
filter.
Also, you don't need a JMESPath expression and a json_query
for such a simple requirement, you can use map
for this.
So, your task should end up being
QUESTION
I am reading from a CSV file, register a variable and loop through the variable's list. It's as easy as below example:
...ANSWER
Answered 2022-Jan-20 at 13:07The items on the list are strings. For example
QUESTION
I'm trying to get server name as user input and if the server OS is RHEL7 it will proceed for further tasks. I'm trying with hostvars but it is not helping, kindly help me to find the OS version with when condition:
...ANSWER
Answered 2022-Jan-05 at 11:01You need to gather_facts
on the newly added host before you consume the variable. As an example, this will do it with automatic facts gathering.
QUESTION
I'm using AWX as a task runner to run a variety of Ansible modules. Some of the Ansible modules are third-party modules whose parameters I can't control without forking the module, which is undesirable for a variety of reasons.
AWX supplies ansible_user
as one variable that is used by some of the modules I'm using, and I'm trying to allow a user to some hosts by setting another variable, user_override
.
I first thought to simply add the line ansible_user: "{{ user_override | default(ansible_user) }}"
to the task's parameters, which would work... but the modules in question don't accept credentials via parameters. My next thought was to add a vars:
entry to the playbook and supply the override there via the same markup as above. This unfortunately results in the error recursive loop detected in template string
, which has been the bane of my existence while working through this problem.
I've also tried using the if/else syntax and intermediate variables, but neither appear to solve this problem.
How can I achieve this override functionality without forking AWX or the module in question?
Mods: This is distinct from the pile of questions asking about simple variable defaulting because the existing questions aren't in the context of AWX or can be solved by simply using default()
or default(lookup())
.
ANSWER
Answered 2021-Dec-23 at 14:39At this point, I'm pretty sure that the thing I (the asker) was trying to do is intended to be done by just sometimes setting a value, but some challenging-to-anonymize constraints in our software make that somewhere between challenging and not an option.
A sideways solution to the particular problem of overriding the user is that AWX sets the username in remote_user
as well as ansible_user
, which is then used by networkcli
. So you can use the line `remote_user: "{{ override_user | default(ansible_user) }}". This doesn't help generally, but does answer the question.
QUESTION
We've had a working Ansible AWX instance running on v5.0.0 for over a year, and suddenly all jobs stop working -- no output is rendered. They will start "running" but hang indefinitely without printing out any logging.
The AWX instance is running in a docker compose container setup as defined here: https://github.com/ansible/awx/blob/5.0.0/INSTALL.md#docker-compose
ObservationsStandard troubleshooting such as restarting of containers, host OS, etc. hasn't helped. No configuration changes in either environment.
Upon debugging an actual playbook command, we observe that the command to run a playbook from the UI is like the below:
ssh-agent sh -c ssh-add /tmp/awx_11021_0fmwm5uz/artifacts/11021/ssh_key_data && rm -f /tmp/awx_11021_0fmwm5uz/artifacts/11021/ssh_key_data && ansible-playbook -vvvvv -u ubuntu --become --ask-vault-pass -i /tmp/awx_11021_0fmwm5uz/tmppo7rcdqn -e @/tmp/awx_11021_0fmwm5uz/env/extravars playbook.yml
That's broken down into three commands in sequence:
ssh-agent sh -c ssh-add /tmp/awx_11021_0fmwm5uz/artifacts/11021/ssh_key_data
rm -f /tmp/awx_11021_0fmwm5uz/artifacts/11021/ssh_key_data
ansible-playbook -vvvvv -u ubuntu --become --ask-vault-pass -i /tmp/awx_11021_0fmwm5uz/tmppo7rcdqn -e @/tmp/awx_11021_0fmwm5uz/env/extravars playbook.yml
You can see in part 3, the -vvvvv
is the debugging argument -- however, the hang is happening on command #1. Which has nothing to do with ansible or AWX specifically, but it's not going to get us much debugging info.
I tried doing an strace
to see what is going on, but for reasons given below, it is pretty difficult to follow what it is actually hanging on. I can provide this output if it might help.
So one natural question with command #1 -- what is 'ssh_key_data'?
Well it's what we set up to be the Machine credential in AWX (an SSH key) -- it hasn't changed in a while and it works just fine when used in a direct SSH command. It's also apparently being set up by AWX as a file pipe:
prw------- 1 root root 0 Dec 10 08:29 ssh_key_data
Which starts to explain why it could be potentially hanging (if nothing is being read in from the other side of the pipe).
Running a normal ansible-playbook from command line (and supplying the SSH key in a more normal way) works just fine, so we can still deploy, but only via CLI right now -- it's just AWX that is broken.
ConclusionsSo the question then becomes "why now"? And "how to debug"? I have checked the health of awx_postgres, and verified that indeed the Machine credential is present in an expected format (in the main_credential
table). I have also verified that can use ssh-agent on the awx_task container without the use of that pipe keyfile. So it really seems to be this piped file that is the problem -- but I haven't been able to glean from any logs where the other side of the pipe (sender) is supposed to be or why they aren't sending the data.
ANSWER
Answered 2021-Dec-13 at 04:21Had the same issue starting this Friday in the same timeframe as you. Turned out that Crowdstrike (falcon sensor) Agent was the culprit. I'm guessing they pushed a definition update that is breaking or blocking fifo pipes. When we stopped the CS agent, AWX started working correctly again, with no issues. See if you are running a similar security product.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install awx
You can use awx like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page