Questions tagged [ansible-galaxy]

Ansible Galaxy is a portal that provides Ansible roles that are shared by users and could be used by other users (e.g. instead of creating a role that installs git, a user could search a role in Ansible Galaxy and reuse it)

Ansible Galaxy is a portal that provides Ansible roles that are shared by users and could be used by other users.

For example, instead of creating a role that installs git, a user could search a role in Ansible Galaxy and reuse it to avoid reinventing the wheel.

Project homepage

https://galaxy.ansible.com/

19 questions
3
votes
2 answers

How can I replace a template file in an Ansible role?

Some Ansible roles, such as https://github.com/bertvv/ansible-role-hosts, use template files that may be a near miss for the needs of this project. When the role author has not provided a variable substitution for the name of the template, is there…
2
votes
1 answer

ansible -how to pickup hostname and create self signed certificate

i have working command for creating self signed certificate for IHS server's .kdb file and i was trying to use the same command through ansible. Here my aim is that ansible should detect the hostname of application servers and should use that name…
Vowner
  • 23
  • 1
  • 3
1
vote
0 answers

change a group_var on every 20 executions

I have an Ansible project with more or less 100 hosts (much more in a near future), this project does several calls to an API that as a limit rate of 1000 calls per token. In my project I define the token on group_vars and what I want is to run a…
João Pereira
  • 39
  • 3
  • 7
1
vote
1 answer

Ansible: access variables and dump to CSV file

vars: servers: - name: centos port: 22 tasks: - name: Check if remote port wait_for: host={{ item.name }} port={{ item.port }} timeout=1 ignore_errors: True register: out with_items: "{{ servers }}" - debug: var=out - name: Save…
Ricky Vene
  • 21
  • 1
  • 4
1
vote
1 answer

How to specify default variables for imported Ansible Galaxy roles?

When writing a custom role for an Ansible playbook, it's possible to specify defaults. I would like to do the same when using a role from Ansible Galaxy (the Ansible “package manager”). For example, when using the popular redis role, I'd like to be…
mknecht
  • 111
  • 3
1
vote
1 answer

Why is the travis badge not assigned to the role in ansible galaxy?

According to this documentation it should be possible to add a travis badge to an ansible role in galaxy: Push the changes to your GitHub repo. This will kick-off a Travis build. When the build completes, Travis will notify Galaxy, and your …
030
  • 5,731
  • 12
  • 61
  • 107
1
vote
1 answer

Is Ansible module for Brocade/ICX is misbehaving?

I've to perform some network automation in my infra using Ansible. When I'm trying to use Ansible module for ICX switches it seems to be misbehaving. Playbook I used - name: ICX switch testing hosts: test-switch gather_facts: no vars: …
saurabh
  • 56
  • 2
1
vote
1 answer

Ansible module to look for new hostname and update config file

Can you help fix this? I am trying to write the hostname into a file. --- - name: Update host. hosts: all connection: local # Default Value domain: '{{ default_domain }}' hostname: “serv1.{{ '{{' }} domain {{ '}}' }}" tasks: -…
Gabby Seyi
  • 15
  • 4
0
votes
1 answer

Ansible variable is not being updated

Ansible variable is not being updated from on unmatched conditions I have the below playbook which actually compares two routers(basically pairs) for running configuration and if there is a match and mismatch it should report out. --- - hosts:…
pinkbask
  • 1
  • 3
0
votes
1 answer

How to read ansible debug output as a variable in Json file .. example below

This is my debug output .. register: create - debug: msg: "{{ create.json.info.0.value }}" ok: [localhost] => { "msg": "8308a020-5c9d-4936-8f1a-40f408d3a085" } Now I need to add the output as an input to JSON template. Below is…
Sandeep C H
  • 11
  • 1
  • 2
0
votes
2 answers

ansible replace module is not working as expected

my ansible play book is working for me to uncomment certain lines in a .conf file, but its failing for one particular line its not making any change. below is my .conf file part. # #SSLEnable #Header always set…
0
votes
2 answers

Where do I put group_vars in an ansible setup and galaxy role

I'm trying to use my first playbook with a galaxy role and while I can get the role to run, I can't seem to get it to find the group_vars I've defined. The role is nickjj.mariadb (not that that probably matters) but in the docs its stated that…
Peter Nunn
  • 432
  • 1
  • 10
  • 24
0
votes
1 answer

ansible: insert content of wordpress unique keys and salt into variable

in handlers/main.yml I've got: - name: get API information for wp-config uri: url: "https://api.wordpress.org/secret-key/1.1/salt/" return_contents: yes register: api_info The tasks I'm trying to run are: - name: copy…
Lethargos
  • 396
  • 1
  • 4
  • 16
0
votes
1 answer

Ansible | conditional statements should not include jinja2 templating | when group_name variable

I have a simple ansible main_task.yml file which is looped from a main.yml . inventory.ini [port_22] 192.168.0.189 192.168.0.199 [port_222] 192.168.0.199 [port_888] 192.168.0.200 main_task.yml --- - name: "run this on {{ item }} hosts" debug:…
0
votes
0 answers

Search and list AWX-Inventory in a playbook

I need help with Ansible AWX Inventory. We have many/different inventories on our AWX server which we are importing through different methods. I have a requirement to search and fetch inventory names in a playbook and put it in a list, which starts…
1
2