Questions tagged [ansible-tower]

Use for questions about programming issues related to the Ansible Tower REST API. Questions about using the Ansible Tower GUI for managing both cloud-based and traditional/hybrid Ansible deployments should be asked on ServerFault.com.

Ansible Tower (formerly ‘AWX’) is a web-based solution that makes Ansible even more easy to use for IT teams of all kinds. It’s designed to be the hub for all of your automation tasks.

Tower allows you to control access to who can access what, even allowing sharing of SSH credentials without someone being able to transfer those credentials. Inventory can be graphically managed or synced with a wide variety of cloud sources. It logs all of your jobs, integrates well with LDAP, and has an amazing browsable REST API. Command line tools are available for easy integration with Jenkins as well. Provisioning callbacks provide great support for autoscaling topologies.

Questions about using the Ansible Tower GUI for managing both cloud-based and traditional/hybrid Ansible deployments should be asked on ServerFault.com.

343 questions
3
votes
1 answer

How to use IF ELSE in YAML with variable?

I am using a YAML file for the Ansible Tower with the following information - name: "Package Deployment" block: - name: "Update package {{ package }}" yum: update_cache: True update_only: True name: "{{ package…
Dewang Dave
  • 49
  • 2
  • 10
3
votes
1 answer

Ansible converting month to integer

I haven't found anything for this yet. I am using Ansible and I'm trying to change some values after a decent amount of time. But my problem is I get a value like: 2020 Nov 19 But I need it to be like: 2020 11 19 How can I do this?
VallingSki
  • 133
  • 4
3
votes
1 answer

Ansible ansible_password undefined variable

This is driving me crazy. My playbook looks as follows: --- …
Billy Billy
  • 423
  • 4
  • 14
3
votes
1 answer

Can Ansible AWX / Tower use group_vars and host_vars from external source / Git repository?

Standard CLI Ansible looks for the group_vars and host_vars directory in the same location as the host file. See for example How can I change the path of group_vars and host_vars?. Ansible AWX / Tower has the option of using an "external source" for…
onknows
  • 6,151
  • 12
  • 65
  • 109
3
votes
1 answer

Getting OAuth2 token from ansible tower with python?

I am trying to get/create an OAuth2 access token with this python script: import requests import json token_url = 'https://mytower.example.com/api/v2/tokens/' data = { "description": "My Access Token", "application": 2, "scope":…
Red Cricket
  • 9,762
  • 21
  • 81
  • 166
3
votes
2 answers

How to block overriding variables by extra_vars in Ansible?

I am using Ansible Tower to expose play. User stars job calling REST API and she/he provides some extra_vars. I have to validate provided variable against some other variables. For example: user provides hostname and I have in the inventory…
mefju
  • 539
  • 7
  • 26
3
votes
2 answers

Can ansible variables be used to declare hosts in a playbook?

I have a playbook in the format below: --- - hosts: myIP tasks: - name: Install a yum package in Ansible example yum: name: ThePackageIWantToInstall state: present where myIP and ThePackageIWantToInstall are variables. When the…
3
votes
2 answers

Ansible Tower API not accepting token

I am performing the following POST in a Tower server: http:///api/v2/job_templates/10/launch/ Headers: Content-Type:application/json Authorization:sometokenhere And getting back the error: {"detail":"Authentication credentials were…
pkaramol
  • 16,451
  • 43
  • 149
  • 324
3
votes
2 answers

Ansible-Tower ssl: the specified credentials were rejected by the server

I am getting the following error when using ansible-tower to connect to my windows machine. I did go use the ansible tower connecting to windows where they suggested to use the following under inventories > variables: ansible_connection:…
penumalla
  • 41
  • 1
  • 1
  • 3
3
votes
1 answer

Ansible Tower exposing password

In one of my Ansible Playbooks, I use the vmware_guest module to create VMs on vCenter Server. When I run the Playbook on Ansible Tower using a job template and check the host events, I see the password in plain text I didn't provide the password…
Chethan S.
  • 558
  • 2
  • 8
  • 28
2
votes
0 answers

Prevent pytest from caching modules that dynamically modify and reimport themselves

I am trying to use pytest to test some code that uses towerlib, an external Python package. Part of the functionality is that towerlib will dynamically add different attributes to its credential.py module, and then the class imports its own module…
pythko
  • 114
  • 7
2
votes
2 answers

Ansible AWX issue - JMESPATH

I am facing an issue with AWX Tower instance. I have a project and job template on it and the job template is connecting to Ansible control node running on (Red Hat Enterprise Linux Server release 7.9 (Maipo)), where couple of playbooks are…
2
votes
1 answer

Redirect verbose stream to stdout

I would like to enrich my Ansible logs with info from the Verbose stream. Using Ansible 2.9.25 with Powershell 5.1 So I am trying to tie verbose output to standard out: - win_shell: Expand-Archive jinja2_files.zip -DestinationPath . -Force -Verbose…
2
votes
1 answer

Getting Ansible Tower API authentication token from C#

I tried using this C# code below, but getting status code 401 (reason:unautherized): var baseUri = "https://ansibletower1.test1.com"; var data = @"{'username':'test123', 'password':'a1b2c3Z0!-99', 'description':'Ansible Api token',…
Mahesh
  • 309
  • 4
  • 8
1
2
3
22 23