Reddit » Ansible
1 FOLLOWERS
Automation for the People! A Subreddit dedicated to fostering communication in the Ansible Community, includes Ansible, AWX, Ansible Tower, Ansible Galaxy, ansible-lint, Molecule, etc.
Reddit » Ansible
2d ago
Could someone please help me out, the error is that each of the found files already exist.
Thanks I appreciate it!
home-assistant - name: Recursively change ownership of a directory ansible.builtin.file: dest: "{{ item }}" state: directory recurse: yes owner: root group: root mode: '0644' with_fileglob: - "/etc/ssh/*key*"
submitted by /u/ponyboy3
[visit reddit] [comments ..read more
Reddit » Ansible
2d ago
I have a set_fact task where I want to loop through some keys in a dict and only set the variable value based on certain conditions. What seems to be happening though is that the when: conditional is superseding with_items:, causing the conditional to fail and the task to not run. Is there a specific way I need to implement this, or is there maybe an issue with my syntax?
- name: Set value if substring in key
set_fact:
var_a: "{{ item.key }}
when: "substring_x in item.key"
with_items: "{{ my_dict | dict2items }}"
submitted by /u/FragilePower
[visit reddit] [comments ..read more
Reddit » Ansible
2d ago
Hi there,
I just start to use Ansible in our environment. Mixed feeling so far.
Anyway, I pass some linux command's result to a variable like this:
name: get uptime
ansible.builtin.shell: uptime -p
register: uptimevar
When all servers are up, this works fine. But when some servers are unreachable, Ansible playbook didn't return what I need.
I'd like Ansible assign something like 'Unreachable' to uptimevar when server is unreacheable.
How can I do it? Thanks!
submitted by /u/HumbleFail4017
[visit reddit] [comments ..read more
Reddit » Ansible
2d ago
Hi there,
I just start to use Ansible in our environment. Mixed feeling so far.
Anyway, I pass some linux command's result to a variable like this:
name: get uptime
ansible.builtin.shell: uptime -p
register: uptimevar
When all servers are up, this works fine. But when some servers are unreachable, Ansible playbook didn't return what I need.
I'd like Ansible assign something like 'Unreachable' to uptimevar when server is unreacheable.
How can I do it? Thanks!
submitted by /u/HumbleFail4017
[visit reddit] [comments ..read more
Reddit » Ansible
2d ago
Apologies if I should've directed this question for homebrew, mac or similar, but I have been struggling getting ansible to work on my Mac laptop and I am kind of at a loss for what to do.
Also I'm still, maybe obviously, on the novice side of ansible, however, I've always been able to do this much when running the same setup from any Linux machine I've tried.
I'm trying to connect to a switch using ansible, but I always get a an error saying
"msg": "Failed to authenticate: Authentication failed: transport shut down or saw EOF"
However, I am 100% certain I'm typing the correct password, even ..read more
Reddit » Ansible
2d ago
Hello!
Im currently stuck, Im trying to use an ansible-playbook to create a kvm inside proxmox.
My playbook does not prompt any issues when run, however i get following fatal error:
TASK [Create MC VM] ***************************************************************************
fatal: [nodeserver]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: ssh: Could not resolve hostname nodeserver: Temporary failure in name resolution", "unreachable": true}
This is my inventory file (with commented out failed tests)
#[linux]
#root@192.168.100.106
#ansible_ssh_pass ..read more
Reddit » Ansible
2d ago
*SOLVED - problem was with rsync ***
I created a play to restore a backup on a server:
- name: Synchronize local backup files to remote server
ansible.posix.synchronize:
src: "{{ local_backup_root_directory }}/{{ local_selected_backup_directory }}/"
dest: "{{ remote_backup_directory }}/"
mode: push
archive: yes
rsync_opts:
- "--archive"
- "--compress"
- "--partial"
- "--progress"
- "--rsync-path=rsync"
- "--no-perms"
- "--no-owner"
- name: Extract bitnami backup on remote server
ansible.builtin.unarchive:
src: "{{ remote_backup_directory }}/bitnami_backup.tar.gz"
dest: /home/user/bitnami
remo ..read more
Reddit » Ansible
2d ago
Good day everyone, I think I'm having a silly issue trying to assing a variable value to a vars_files, take a look please:
name: test
hosts: all
become: true
vars:
pak: "{{ ansible_facts['os_family'] }}"
vars_files:
"apache_default.yml"
"apache_{{ pak }}.yml"
when running the playbook I get the error: apache_{{ pak }}.yml was not found because the file I want to be found is apache_RedHat.yml, but the variable value is not being assigned to the file name.
Thanks in advance.
submitted by /u/linkme99
[visit reddit] [comments ..read more
Reddit » Ansible
2d ago
This week in Ansible Community
Issue #139, 2024-05-27 (Past Issues)
Welcome to The Bullhorn, our newsletter for the Ansible Community. If you have any questions or content you’d like to share, you're welcome to chat with us in the Ansible Social room on Matrix, and mention newsbot to have your news item tagged for review for the next weekly issue!
KEY DATES ⏱️
2024-05-28: DaWGs meeting, 15:00 UTC
2024-05-29: Community WG meeting, 18:00 UTC
2024-05-30: Bullhorn #137 content deadline, 18:00 UTC
2024-06-17: ETA for Ansible-Core 2.17.1
2024-06-04: ETA for Ansible-10.0.0rc2 when necessary, other ..read more
Reddit » Ansible
2d ago
Hello,
How can I send a command either by shell or commad to a Citrix machine?
Regards;
submitted by /u/BigRevolutionary4858
[visit reddit] [comments ..read more