Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options answers only not deleted user 210

Use this tag for questions about Ansible, an open-source automation engine, related to using Ansible for topics such as cloud provisioning, configuration management, application deployment, etc.

1 vote

ansible AWX is connecting through ssh as root instead of user defined in credential

According to https://docs.ansible.com/ansible/latest/user_guide/playbooks_intro.html it should be remote_user: if it still does not work, run the playbook with -vvvv and add the log to the Q&A. …
030's user avatar
  • 13.3k
1 vote
Accepted

ansible question to execute and display multiple commands

One could use -vvv to get the output of the commands while running the playbook: changed: [localhost] => (item=echo helloworld) => { "ansible_loop_var": "item", "changed": true, "cmd": …
030's user avatar
  • 13.3k
3 votes

reboot server during Ansible tasks

https://docs.ansible.com/ansible/latest/modules/reboot_module.html - name: Unconditionally reboot the machine with all defaults reboot: - name: Reboot a slow machine that might have lots of updates …
030's user avatar
  • 13.3k
2 votes

How do I run Ansible Azure playbooks while avoiding storing credentials in files?

Please read https://docs.ansible.com/ansible/2.4/vault.html Since Ansible 2.4 one could use --vault-id @prompt. … Encrypt a file using ansible-vault: ansible-vault encrypt /path/to/encrypted/file Run the playbook and it will result in: fatal: [localhost]: FAILED! …
030's user avatar
  • 13.3k
1 vote

Ansible translation: Installing Apache + Certbot in Ubuntu

If you really want to create the role yourself, you have to use --agree-tos --noninteractive to disable user interaction. See https://certbot.eff.org/docs/using.html for more details
030's user avatar
  • 13.3k
1 vote

Conditionally run certbot

One could use the apt module of Ansible. http://docs.ansible.com/ansible/latest/apt_module.html The apt module uses apt and apt itself is able to check whether a package has already been installed and … https://github.com/030/ansible-certbot/blob/master/tasks/Debian.yml#L10 - name: certbot installed apt: name: certbot state: latest …
030's user avatar
  • 13.3k
4 votes
Accepted

Installing Ansible Controllers to build agents which best practice to use?

Although it is unclear to me what the aim is of your question, it is possible to use a continuous integration (CI) tool like, Jenkins, gitlab, circleci that pulls the code from git, installs ansible or … use an image that contains ansible in order to run a playbook. …
030's user avatar
  • 13.3k
1 vote

Parallelising Packer with Ansible

What about using a CI tool? Create a parallel job and the jobs will run parallel. For example, one could use Jenkins: https://jenkins.io/blog/2017/09/25/declarative-1/ stage('run-parallel-branches' …
030's user avatar
  • 13.3k
2 votes

Change Ansible module based on variable or group

It is possible to declare group and host vars http://docs.ansible.com/ansible/latest/playbooks_best_practices.html group_vars/ group1 # here we assign variables to particular groups …
030's user avatar
  • 13.3k
2 votes

Discovering extra args needed for running ansible playbooks

This means the role will bring along a default value but ANYTHING in Ansible will override it. It’s just a default. … There is a number of galaxy playbooks that could be checked: https://github.com/geerlingguy/ansible-role-nginx https://github.com/shelleg/ansible-role-gradle https://galaxy.ansible.com/030/firefox/ …
030's user avatar
  • 13.3k
2 votes

How to run Ansible with sudo no password commands with become syntax

Did you try -K already? I always use this option and then a sudo password has to be entered
030's user avatar
  • 13.3k
1 vote

How to setup testkitchen with ansible-provisioning from localhost for different vagrant-vms?

According to this documentation it is possible to install ansible and run a ansible playbook by using the following snippet: Vagrant.configure("2") do |config| # # Run Ansible from the Vagrant Host … # config.vm.provision "ansible" do |ansible| ansible.playbook = "playbook.yml" end end …
030's user avatar
  • 13.3k
1 vote

Validating certificates with get_url or yum on CentOS 7 using Ansible

I suggest that you do not reinvent the wheel and use a ansible galaxy role that has already solved the issues you are reporting. … It is possible to install this by issuing ansible-galaxy install geerlingguy.git and subsequently include geerlingguy.git in the roles in order to apply the role on the nodes. …
030's user avatar
  • 13.3k
3 votes

Three solutions to structure a deployment with Ansible?

I would recommend to structure the code as defined in the Ansible Best Practices document: and to follow the structure that major contributors to the ansible galaxy platform use, like geerlingguy. … If one will follow a significant different structure then it will be really hard in the future to reuse roles from the ansible galaxy community and one has to reinvent the wheel. …
030's user avatar
  • 13.3k
1 vote

Error Vagrant Provisioning with Virtual Box on Fedora

Try to start with a clean sheet by removing the .vagrant.d folder or start to remove the corrupted zip. When the file or folder has been removed, one could run vagrant up again and check whether it wo …
030's user avatar
  • 13.3k

15 30 50 per page