Questions tagged [ansible-2.x]

Ansible is a radically simple IT automation platform that makes your applications and systems easier to deploy. Avoid writing scripts or custom code to deploy and update your applications— automate in a language that approaches plain English, using SSH, with no agents to install on remote systems

Ansible 2.x is a new backwards-incompatible version that involved a rewrite of the core, and a new API.

Ansible 2.x features new commands like ansible-vault, allowing you to store encrypted information in playbooks and have them decrypted on the fly. It also includes new concepts like Task Blocks, Dynamic Includes, Execution Strategy Plugins, and a suite of new "batteries included" modules. Most importantly, new releases are named after Led Zepplin songs, rather than Van Halen.

https://raw.githubusercontent.com/ansible/ansible/stable-2.0/CHANGELOG.md

Related Tags

1908 questions
0
votes
1 answer

How to register a variable when using loop with stat module?

How to register a variable when using loop with stat module? I am working on a project where I wish to run comparisons against the known value of a collection of files (checksum), which I will then take action if a change is detected (EG: notify…
inversecow
  • 33
  • 7
0
votes
0 answers

ansible action plugin expand ansible fact

i have been trying to use what is here in order to pass the hostname to a module use ansible_facts in module code i have the code below which normally will create a fact which i can after use with the template or copy module to copy a file…
zn553
  • 87
  • 7
0
votes
0 answers

How to remove a specific block of lines from prometheus.yml file using ansible?

I have a prometheus.yml config file which have multiple k8s clusters configured for monitoring. Since the servers come and go we need to delete the servers which are deleted from our peometheus.yml config file using ansible. I tried with the…
0
votes
1 answer

Ansible task is failing even with the right syntax

I am learning ansible and i have written a task for LDAP validation. However, when i run the playbook, the task is failing even when the validation is correct. Below is the ansible task which will check for the LDAP password max age - name: LDAP…
0
votes
1 answer

How to execute task on all hosts from group when playbook is executed with limited hosts?

Scenario I have a group A in my inventory, where A contains a1,a2,a3 hosts. It does mean that I can write in my playbook X.yml: - hosts: A roles: - role: name: r The problem is about playbook X is started with limited number of hosts,…
Tom
  • 7
  • 6
0
votes
2 answers

How can I save values into a list var from multiple tasks in ansible?

I have a playbook where I execute several tasks. Each task can be executed if it meets the WHEN condition. I would like to save some data into a list so I can use it later in the process. Here is an over simplified example to illustrate my need: -…
Kornikopic
  • 188
  • 1
  • 15
0
votes
1 answer

How to skip role when host is unreachable?

I have disable_root role, which creates admin user and disables root user from connecting to server via ssh. When I rerun playbook with this role for second time I get unreachable error (which is ok, as I just disabled it). I'd like to skip this…
Marcin Doliwa
  • 3,639
  • 3
  • 37
  • 62
0
votes
0 answers

how to do a successful exit from the playbook task

I have a playbook which is repeating one task, shell is invoked from ansible task, but it does not exit successful on completion of task and repeating the shell instructions again. Playbook: --- hosts: dev-servers tasks: - name: clean up…
Time
  • 143
  • 1
  • 1
  • 10
0
votes
1 answer

how to pass "physical path credentials to win_iis_webapplication" command in Ansible to create a web application and setting credentials

I am trying to create the Webapplication using Ansible with the win_iis_webapplication command. I am unable to set the "physical path credentials" for the site using this command. Could someone help me on how to pass the credentials with the…
0
votes
1 answer

Trying to ping windows host uing ansible, but not successfull

I am trying to ping windows host from using ansible, but unable to ping. getting below errors: fatal: [localhost]: FAILED! => { "changed": false, "module_stderr": "#< CLIXML\r\n
0
votes
2 answers

Script needs to be run as root error after already using become, become_user, and become_method

Writing a task to run an install script and normally it would have to be run with : sudo ./install.sh My task looks like: - name: Run the installer shell: "{{ tempdir_output.path }}/device_manager_osx*/install.sh" become: true …
0
votes
1 answer

How to keep session alive while running the playbook for longer period of time?

I am running ansible playbook to restart some of our servers but we need to sleep for 40 minutes between each server restart so if I sleep for 40 minutes in my playbook then it sleeps for a while but then my session gets terminated on Ubuntu box in…
flash
  • 1,455
  • 11
  • 61
  • 132
0
votes
0 answers

Is there an option on Ansible for getting squid service status?

I'm setting up a new playbook, and want to support both service status and systemctl status. I want to monitor a service called Squid on Ubuntu 14.04 that has only service and 16.04 that has both service and systemctl. I had tried using How to get…
Dor Shamay
  • 345
  • 1
  • 4
  • 21
0
votes
1 answer

run an inluded files in parallel on same target

my target is to be able to configure multiple iis website on the same target and in parallel. each website has multiple tasks that configures it, like creating app pool, creating website, setting the website app pool, create the needed directory…
eyh
  • 1
  • 4
0
votes
1 answer

How to define when condition based on matching string

I am writing a playbook where i need to select host which will be a part of group which starts with name "hadoop". The host will be supplied as an extra variable in term of parent group. The task is about upgrading the java on all machines with repo…