Re: [ansible-project] replace string in file created by root on remote server

2018-04-14 Thread Kai Stian Olstad
On Saturday, 14 April 2018 10.01.38 CEST Agoston Bejo wrote: > Version a) > > - name: create the file as root > shell: 'echo "Test_string" > /root/test.txt' > remote_user: root > > - name: replace '_' with '-' in the file > replace: > path: "/root/test.txt" > regexp: '_' >

Re: [ansible-project] How to recover from expected connection loss?

2018-04-14 Thread Kai Stian Olstad
On Wednesday, 11 April 2018 15.56.25 CEST Uwe Sauter wrote: > ## playbook > --- > - name: run preparations > hosts: '{{ groups["image_creator"] | first }}' > gather_facts: false > tasks: > - name: recreate locale archive > shell: /root/bin/rebuild_locale.sh >

Re: [ansible-project] Re: Getting two results with custom callbacks

2018-04-14 Thread Kai Stian Olstad
On Friday, 13 April 2018 21.14.12 CEST tommcf64 wrote: > Here is my my playbook. I am also running ansible version 2.4.2.0 > --- > - hosts: all > tasks: > - name: Run setup > setup: > # register: variables Default Ansible is running gather_facts, so when you are using the setup

Re: [ansible-project] Ansible : get running config from aruba switches

2018-04-14 Thread Kai Stian Olstad
On Friday, 13 April 2018 13.12.40 CEST Martial CHAVIGNY wrote: > Hello, > > I'm new user of ansible and for the first projet, I would to get current > config of aruba (2930F) switches (for backup). > > I read these documentations : > >

[ansible-project] ansible playbook become-method not working

2018-04-14 Thread Benny Kusman
Hi, so i got this playbook with this header: --- #WEBSERVVER - hosts: webserver user: ansible become: yes become_method: su when running the playbook via command: ansible-playbook -i ../hosts webserver.yml -K SUDO password: Instead of asking for su password, it's somehow asking for

[ansible-project] ansible inventory file not found when running from subfolder

2018-04-14 Thread Benny Kusman
Hi, So i got this error: [WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all' This is the ansible information [ansible@laansible1]$ ansible --version ansible 2.5.0 config file = /etc/ansible/ansible.cfg configured

[ansible-project] replace string in file created by root on remote server

2018-04-14 Thread Agoston Bejo
Hi! What I'm trying to do is very "complicated" task: 1. create a file on the remote server as root (in /root) 2. replace a string in the file I just can't seem to achieve this without resorting to executing shell commands directly. (Any more than I already am, that is.) Version a) - name:

[ansible-project] timed out. (connect timeout=30)

2018-04-14 Thread subbireddy gajulapalli
172.31.45.80 | UNREACHABLE! => { "changed": false, "msg": "ssl: HTTPSConnectionPool(host='172.31.45.80', port=5986): Max retries exceeded with url: /wsman (Caused by ConnectTimeoutError(, 'Connection to 172.31.45.80 timed out. (connect timeout=30)'))", "unreachable": true Please

[ansible-project] Ansible 2.5 is not accepting dynamic hosts variable

2018-04-14 Thread Daniel Palmer
Did you ever resolve this issue? Or find an acceptable workaround? I have the same issue and that is a core part of many of our playbooks. DP -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop

[ansible-project] Ansible : Add multiple security group on ec2

2018-04-14 Thread Ankur Gupta
I have one ec2 instance(*instance_A)*, and I have to create one more new ec2 instance(*instance_B*) using instance_A ec2_fact. to get facts of ec2 I am using the *ec2_instance_facts* module.on *instance_A* have multiple security groups which I want to add on *instance_B* on creation time. I

[ansible-project] Re: Variables with quotes

2018-04-14 Thread Shaun Lim
Thanks for the tip Larry. I wanted to create my own module as I am learning Ansible. In any case, I managed to get it done by splitting each type of permission into its own variable. I think a combined string with too many quotes caused some parsing issues. Regards, Shaun On Saturday, 14