Search Results
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 |
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.
7
votes
Accepted
Is it possible to combine jinja templates in ansible like this is possible with erbs in puppet?
Yes, that is possible according to this post.
When a second jinja template was created and this was included in the base jinja it was called.
{% include "checks/subdue.j2" %}
4
votes
Accepted
How to ensure that removed allowed ports will be removed using Ansible's UFW module?
Either use delete=yes
# or a separate state=reset task)
The following snippet was added to the top of the file:
---
- name: Reset UFW
ufw:
state: reset
Once ansible was run:
TASK [rolename …
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. …
4
votes
Is there an ansible module that check whether a port is not in LISTEN state?
[WARNING]: Could not create retry file
'/etc/ansible/roles/role_under_test/tests/test.retry'. [Errno 30] Read-
only file system: u'/etc/ansible/roles/role_under_test/tests/test.retry' …
3
votes
How to structure DevOps related code and configs in a code repository?
Making a distinction between Ops, Dev and DevOps promotes isolation and enforces a "throw it over the wall" mindset. To increase cooperation between teams one should put everything in a repository tha …
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 …
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. …
2
votes
Accepted
What are best practices of deploying docker-compose using Ansible?
Instead of using a symlink that will be stored as is in BitBucket one could use:
- name: Copy docker-compose.yml
copy:
src: ../../../../docker-compose.yml
dest: /path/to/docker-compose.yml
…
2
votes
Running Ansible no-op's faster with a dynamic inventory and cached facts files
Instead of storing the Ansible code centrally, one could extract the code and distribute it to every project. …
2
votes
Ansible - private git repositories - SSH agent forwarding vs copying private SSH key
project and copy it using Ansible to my target node? … no
https://serverfault.com/questions/823956/ansible-security-best-practices
For servers, don't allow root access via ssh at all. Many audits scoff
at this. …
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
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/ …
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 …
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! …
1
vote
Playbook without relative path to vars
To avoid such issues, that is why there are Hosts and Groups in Ansible. … /etc/ansible/group_vars/raleigh # can optionally end in '.yml', '.yaml', or '.json'
/etc/ansible/group_vars/webservers
/etc/ansible/host_vars/foosball …