Questions tagged [ansible]

Ansible is an open-source software platform for configuring and managing computers. It combines multi-node software deployment, ad-hoc task execution, and configuration management.

Ansible is an open-source software platform for configuring and managing computers. It combines multi-node software deployment, ad-hoc task execution, and configuration management. It manages nodes over SSH and does not require any additional remote software to be installed on them. Modules work over JSON and standard output and can be written in any programming language. The system uses YAML to express reusable descriptions of systems.

The platform was created by Michael DeHaan, the author of the provisioning server application Cobbler and co-author of the Func framework for remote administration. It is included as part of the Fedora distribution of Linux, owned by Red Hat inc., and is also available for Red Hat Enterprise Linux, CentOS and Scientific Linux via Extra Packages for Enterprise Linux (EPEL) as well as other operating systems. Ansible was commercially supported and sponsored by AnsibleWorks. Since October 2015 Ansible is owned by RedHat.

It was named by DeHaan after the fictional instantaneous hyperspace communication system featured in Orson Scott Card's Ender's Game.

1762 questions
9
votes
3 answers

Is the SSH SFTP subsystem required on the managed nodes for Ansible to work?

When I run: ansible all -a "/bin/echo hello" -u myuser I get back: mydomain.myhost.com | FAILED => failed to open a SFTP connection (Channel closed.) The SFTP subsystem is disabled on the managed node I'm trying to connect to. Is SFTP required on…
braveterry
  • 897
  • 2
  • 7
  • 13
9
votes
1 answer

Reusing tasks in Ansible

In Ansible, is it possible to define a set of tasks in one files and then run selected tasks from other playbooks? The documentation describes how to include and reuse the task list, is there a way to run only selected tasks and not the full list?
kefeizhou
  • 211
  • 3
  • 7
9
votes
2 answers

Create user if not exist in Ansible

I want to make sure a given user always exist in a system, so only create when it is not exist my current tasks is: - name: Create default user action: user name={{ user }} groups={{ group }} state=present However, it raise the error when a user…
Ryan
  • 5,831
  • 24
  • 72
  • 91
9
votes
2 answers

ansible: why is the file module skipping?

I have an ansible 1.1 playbook where I do something like this: - name: copy files sudo: True shell: cp /from/* /to/ - name: change…
deadsven
  • 193
  • 1
  • 1
  • 5
9
votes
3 answers

Use Ansible include_tasks with tags on the sub-tasks

Ansible 2.8.1 In my playbook tasks/ dir: main.yml dev.yml In main.yml I have a block like this: - include_tasks: dev.yml when: ec2_tag_env == 'dev' It works fine However, if I try to call a specific task within dev.yml using a tag. It won't…
emmdee
  • 2,187
  • 12
  • 36
  • 60
8
votes
1 answer

Ansible prompt a variable in a task

i'm trying to add a value in inline module in sysctl.conf file, how can i achieve that? once i enter the value in the prompt it should be updated in the sysctl.conf file. - name: shmmax prompt: " Please enter the value for kernel.shmmax " …
snehal s
  • 179
  • 1
  • 3
  • 8
8
votes
5 answers

Ansible task write to local log file

Using Ansible I would like to be able to write the sysout of a task running a command to a local(i.e. on the managed server) log file. For the moment I can only do this using a task like this: - name: Run my command shell:
trikelef
  • 518
  • 1
  • 7
  • 26
8
votes
2 answers

Global handlers in Ansible

Is it possible to have truly global handlers in Ansible so that I can "notify" the handler from any task of any role of any playbook? And without explicitly importing. I just want to define a handler once (say "restart httpd") and have it…
8
votes
2 answers

Show updated packages with Ansible package management

I have a simple Ansible playbook that I use to run updates on all the servers I manage: - hosts: ubuntu tasks: - name: install all updates apt: upgrade: dist update_cache: yes autoremove: yes autoclean: yes - hosts:…
Gerald Schneider
  • 23,274
  • 8
  • 57
  • 89
8
votes
3 answers

How to use existing Vault files in Ansible Tower?

I want to import existing inventories that I have previously used with Ansible (standalone) including group_vars and vault files into Ansible Tower (3.2.0). However, it doesn't seem to work once Vault files come into play. Once I've setup the Vault…
Martial
  • 141
  • 1
  • 1
  • 6
8
votes
2 answers

quoting colon in ansible

I am trying to use ansible to check that the output of a particular program is set to a certain value. That value includes a colon followed by a space, and this seems to register as a syntax error no matter how I quote it. example: --- - hosts:…
stochastic
  • 316
  • 1
  • 3
  • 6
8
votes
3 answers

What is the correct syntax of defining role dependencies in the meta/main.yml in Ansible?

meta/main.yml dependencies: - { role: 030.sensu-install } results in: [DEPRECATION WARNING]: The comma separated role spec format, use the yaml/explicit format instead.. This feature will be removed in a future release. Deprecation warnings can…
030
  • 5,901
  • 13
  • 68
  • 110
8
votes
2 answers

Remove symlink with Ansible

I have a dead symlink named dead_symlink under the directory /usr/local/bin When Ansible check the file it reports it exists - stat: "path=/usr/local/bin/dead_symlink" register: dead_symlink_bin - debug: var=dead_symlink_bin.stat.exists But when…
tvl
  • 369
  • 3
  • 4
  • 10
8
votes
2 answers

What is the equivalent of r10k in Ansible?

Puppet modules like the ones from puppetforge could be deployed using r10k. Question What is the equivalent of this tool in Ansible? Attempt to answer the question This Google Q&A was found that does not answer the question
030
  • 5,901
  • 13
  • 68
  • 110
8
votes
1 answer

Ansible has difficulty restarting Supervisor

I'm trying to restart Supervisor through my Ansible Playbook but I seem to be stumbling into an issue with the supervisor module for Ansible. In my Supervisor config I have defined a…
Luke
  • 3,826
  • 8
  • 36
  • 40