Re: [ansible-project] Re: Copy multiple files to different locations on remote server

2018-11-05 Thread Keshipeddy Anusha
Could someone please help me in writing shell commands On Fri, Nov 2, 2018, 5:07 PM Keshipeddy Anusha I am trying with below playbook and getting errors > > --- > - hosts: all > tasks: > - name : replacing files > Command: > args: > src: /tmp/file1 >

[ansible-project] Re: need to replace a line in config file

2018-11-05 Thread visar
Hi Experts, Any suggestion here ? On Monday, November 5, 2018 at 11:51:17 AM UTC+5:30, visar wrote: > > Hi Experts, > > > Please help me with your guidance here. > > I want to comment a line in one config file and need to uncomment the > other lline using ansible. > > My file content as below.

[ansible-project] HTTPConnectionpool(host = 'proxyhost' , port = 9480) , read timed out = 30 error on ansible 2.7.0 , remote node = windows server 2008

2018-11-05 Thread sase kumar
Hi experts, I'm basically trying to run ansible playbook or any adhoc task on windows node (prerequisite done) when I execute its waiting for some time and then throwing me this error plaintext: HTTPConnectionpool(host = 'proxyhost' , port = 9480) , read timed out = 30 unreachable: true I

Re: [ansible-project] {"changed": false, "msg": "AnsibleUndefinedVariable: 'ansible.vars.hostvars.HostVarsVars object' has no attribute 'ansible_default_ipv4'"}

2018-11-05 Thread Uwe Sauter
Because he was running the playbook with this commandline: ansible-playbook -i infra --limit mysql04 main.yml --tags "mysql" -vvv Am 05.11.18 um 15:06 schrieb Kai Stian Olstad: > On 04.11.2018 23:50, Tom K. wrote: >> Hey Uwe, >> >> I hear you and apologies.  Was trying to keep it from getting

[ansible-project] Ftp - ansible

2018-11-05 Thread nadim mansour
I have files that I need to transfer from my mac (machine) to windows server and linux server before running several tasks files are binary files and .exe can the files be sent through ftp ? can someone help please -- You received this message because you are subscribed to the Google Groups

Re: [ansible-project] {"changed": false, "msg": "AnsibleUndefinedVariable: 'ansible.vars.hostvars.HostVarsVars object' has no attribute 'ansible_default_ipv4'"}

2018-11-05 Thread Uwe Sauter
Sure, but the template will only be used for the one host and as such should not look for variables of other hosts, right? Am 05.11.18 um 15:18 schrieb Kai Stian Olstad: > On 05.11.2018 15:08, Uwe Sauter wrote: >> Because he was running the playbook with this commandline: >> >> ansible-playbook

Re: [ansible-project] Re: need to replace a line in config file

2018-11-05 Thread visar
Hello Kai, Thanks a lot for your gudance here. Its really appreciated. I am very new to ansible and thought like this is a normal task already done by experts like you and was eager to get a reply on that.. Here i just gone through the xml module and couldnt dfind any information to replace

Re: [ansible-project] {"changed": false, "msg": "AnsibleUndefinedVariable: 'ansible.vars.hostvars.HostVarsVars object' has no attribute 'ansible_default_ipv4'"}

2018-11-05 Thread Kai Stian Olstad
On Monday, 5 November 2018 15:38:51 CET Uwe Sauter wrote: > Sure, but the template will only be used for the one host and as such should > not look for variables of other hosts, right? It will look up the variable on all host in group mysql This is the code in the template {% for host in

Re: [ansible-project] Re: need to replace a line in config file

2018-11-05 Thread Dick Visser
Hi I would not use lineinfile and regular expressions to manipulate XML. You might get it to work, but it will be very fragile. Instead have a look at the xml module, which (if you can get it to work) will be more robust: https://docs.ansible.com/ansible/2.4/xml_module.html Dick On Mon, 5 Nov

Re: [ansible-project] Re: need to replace a line in config file

2018-11-05 Thread Kai Stian Olstad
On 05.11.2018 12:34, visar wrote: Hi Experts, Any suggestion here ? People do work in different timezone and/or are busy so you cant expect an answer one the hour. On Monday, November 5, 2018 at 11:51:17 AM UTC+5:30, visar wrote: My file content as below.

Re: [ansible-project] {"changed": false, "msg": "AnsibleUndefinedVariable: 'ansible.vars.hostvars.HostVarsVars object' has no attribute 'ansible_default_ipv4'"}

2018-11-05 Thread Kai Stian Olstad
On 04.11.2018 23:50, Tom K. wrote: Hey Uwe, I hear you and apologies. Was trying to keep it from getting too messy since the output is large. Link to file is here: http://microdevsys.com/ansible/ansible-vvv.out.txt.gz Just the same, in case you can't get to the file, here's the first 100

Re: [ansible-project] {"changed": false, "msg": "AnsibleUndefinedVariable: 'ansible.vars.hostvars.HostVarsVars object' has no attribute 'ansible_default_ipv4'"}

2018-11-05 Thread Kai Stian Olstad
On 05.11.2018 15:08, Uwe Sauter wrote: Because he was running the playbook with this commandline: ansible-playbook -i infra --limit mysql04 main.yml --tags "mysql" -vvv There you have the problem. He has template code that read variable from all the host in group mysql and running the

Re: [ansible-project] {"changed": false, "msg": "AnsibleUndefinedVariable: 'ansible.vars.hostvars.HostVarsVars object' has no attribute 'ansible_default_ipv4'"}

2018-11-05 Thread Uwe Sauter
As far as I can tell there is no such loop in the template: [root@awx02 mysql]# cat templates/my.cnf.j2 [mysqld] datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock user=mysql binlog_format=ROW bind-address="{{ ansible_default_ipv4.address }}" default_storage_engine=innodb

Re: [ansible-project] {"changed": false, "msg": "AnsibleUndefinedVariable: 'ansible.vars.hostvars.HostVarsVars object' has no attribute 'ansible_default_ipv4'"}

2018-11-05 Thread Kai Stian Olstad
On Monday, 5 November 2018 16:06:19 CET Uwe Sauter wrote: > As far as I can tell there is no such loop in the template: It is, i just formatted it to show it more clearly. > [root@awx02 mysql]# cat templates/my.cnf.j2 > [mysqld] > datadir=/var/lib/mysql > socket=/var/lib/mysql/mysql.sock >

Re: [ansible-project] {"changed": false, "msg": "AnsibleUndefinedVariable: 'ansible.vars.hostvars.HostVarsVars object' has no attribute 'ansible_default_ipv4'"}

2018-11-05 Thread Uwe Sauter
Ah, I missed that line. Thanks. Am 05.11.18 um 16:18 schrieb Kai Stian Olstad: > On Monday, 5 November 2018 16:06:19 CET Uwe Sauter wrote: >> As far as I can tell there is no such loop in the template: > > It is, i just formatted it to show it more clearly. > > >> [root@awx02 mysql]# cat

[ansible-project] Question on using Ansible to upgrade Linux with config file overwrites

2018-11-05 Thread EspressoBeanies
What's the best way to use Ansible to manage software updates where installer config files have the potential to overwrite the config settings you currently have in place? I'm trying to see if there's a way for Ansible to apply software upgrades on all my *NIX machines but notify me when it

Re: [ansible-project] Re: need to replace a line in config file

2018-11-05 Thread Dick Visser
On Mon, 5 Nov 2018 at 15:45, visar wrote: > > Hello Kai, > > Thanks a lot for your gudance here. Its really appreciated. > > I am very new to ansible and thought like this is a normal task already done > by experts like you and was eager to get a reply on that.. > > Here i just gone through the

Re: [ansible-project] Re: need to replace a line in config file

2018-11-05 Thread visar
Hello kai, This is the xml file , where i want to enable Ldap user registry and disable basic local registry using ansible monitor-1.0 jsp-2.2 servlet-3.0 ssl-1.0 appSecurity-2.0

Re: [ansible-project] Manipulating part of a custom variable

2018-11-05 Thread John Harmon
How can I throw in a custom string? Everything I try seems to fail: Working: newname: "{{ oldname.stdout ~ ansible_date_time.date }}" Returns: myserver2018-11-05 Desired: myserver-COPY-2018-11-05 -- You received this message because you are subscribed to the Google Groups "Ansible Project"

Re: [ansible-project] Manipulating part of a custom variable

2018-11-05 Thread John Harmon
Ah, it was the single quotes that I was missing. Thank you. -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscr...@googlegroups.com. To

Re: [ansible-project] Re: need to replace a line in config file

2018-11-05 Thread Dick Visser
On Mon, 5 Nov 2018 at 16:59, visar wrote: > > Hello kai, > > This is the xml file , where i want to enable Ldap user registry and disable > basic local registry using ansible Your XML file actually has multiple include locations, so you'd have to loop through them. Since this is the case, you

Re: [ansible-project] Re: Is there any way to select a single host when using a pattern?

2018-11-05 Thread Brian Coca
put run_once at play level -- -- Brian Coca -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscr...@googlegroups.com. To post

[ansible-project] Why doesn't Ansible like my regexp?

2018-11-05 Thread John Harmon
As far as I can tell I have all of my quotes... it just doesn't seem to like my escaping... Adding verbosity didn't give me any useful information. - name: Sanitize vm.cfg step 2 of lineinfile: path: "{{ file }}" regexp: "{{ item.regexp }}" line: "{{ item.line

Re: [ansible-project] Why doesn't Ansible like my regexp?

2018-11-05 Thread Kai Stian Olstad
On Monday, 5 November 2018 18:13:39 CET John Harmon wrote: > > As far as I can tell I have all of my quotes... it just doesn't seem to > like my escaping... Adding verbosity didn't give me any useful information. > > > - name: Sanitize vm.cfg step 2 of > lineinfile: > path: "{{

Re: [ansible-project] Why doesn't Ansible like my regexp?

2018-11-05 Thread John Harmon
Thanks Kai! That was the issue. No complaints from Ansible now. -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to

Re: [ansible-project] Manipulating part of a custom variable

2018-11-05 Thread Kai Stian Olstad
On Monday, 5 November 2018 18:53:55 CET John Harmon wrote: > How can I throw in a custom string? Everything I try seems to fail: > > Working: > newname: "{{ oldname.stdout ~ ansible_date_time.date }}" > Returns: > myserver2018-11-05 > > Desired: > myserver-COPY-2018-11-05 newname: "{{

[ansible-project] Regexp failure: Unmatched group

2018-11-05 Thread John Harmon
I am getting a failure with the latter half of my task. I replaced the working stuff with According to a regexp tester, every group does have something, and I don't have empty groups. https://regex101.com/r/MNkwaD/1 I changed stdout_callback to minimal, but it didn't look much different.

Re: [ansible-project] Regexp failure: Unmatched group

2018-11-05 Thread John Harmon
> If you that is the only place you have phy: replace module would be a lot > easier. > > - replace: > path: /path/to/file > regexp: (, )?'phy:[^']+' > replace: '' > > > -- > Kai Stian Olstad > > > Yep, you are right. That is much easier. I'll go that route. Out of

Re: [ansible-project] Regexp failure: Unmatched group

2018-11-05 Thread John Harmon
> So you have a regexp that isn't working, but haven't told us what you are > trying to do, so it's actually impossible to help you. > > > -- > Kai Stian Olstad > > > In the link I provided there is a sample string. I capture 6 different groups. In short, I am trying to remove all phy

Re: [ansible-project] Re: Restart kestrelservice

2018-11-05 Thread Nk Chitturi
Thank you all, I am able to run my first playbook successfully. Thanks, Narmada On Saturday, November 3, 2018 at 3:32:32 AM UTC-7, Dick Visser wrote: > > The whole point of the systemd module (or any other module, really) is to > abstract commands away, so don’t have to use them. > Try out the

Re: [ansible-project] Regexp failure: Unmatched group

2018-11-05 Thread Kai Stian Olstad
On Monday, 5 November 2018 22:28:29 CET John Harmon wrote: > > > So you have a regexp that isn't working, but haven't told us what you are > > trying to do, so it's actually impossible to help you. > > > In the link I provided there is a sample string. I capture 6 different > groups. In

[ansible-project] Re: HTTPConnectionpool(host = 'proxyhost' , port = 9480) , read timed out = 30 error on ansible 2.7.0 , remote node = windows server 2008

2018-11-05 Thread Jordan Borean
Looks like you are trying to connect through a proxy? The winrm connection plugin doesn't allow you to explicitly define a proxy in the inventory so it would need to be set in the environment variables using the http_proxy/http_proxy env vars. You can use the newer psrp connection plugin to

Re: [ansible-project] Regexp failure: Unmatched group

2018-11-05 Thread Kai Stian Olstad
On Monday, 5 November 2018 21:56:31 CET John Harmon wrote: > I am getting a failure with the latter half of my task. I replaced the > working stuff with > According to a regexp tester, every group does have something, and I don't > have empty groups. https://regex101.com/r/MNkwaD/1 > I

[ansible-project] gcp_compute plugin showing auth failure

2018-11-05 Thread Murali Krishna
SUMMARY I am using gcp_compute plugin as a inventory source. While on local machine it is working fine but when I try to use this same inventory on GCP VM it is showing ansible-inventory -i ./inventory/gcompute.gcp.yaml --graph [WARNING]: * Failed to parse /inventory/gcompute.gcp.yaml with

[ansible-project] Re: windows - ansible.. create user and run remaining tasks with the user created

2018-11-05 Thread Jordan Borean
Using become is what you need, you shouldn't have to worry about creating the profile as become will do that for you when it first logs on as that user. You just need to make sure you don't manually create that profile before becoming that user as Windows will then create the profile at a

Re: [ansible-project] Ftp - ansible

2018-11-05 Thread Dick Visser
Sounds like just the copy module would work. On Mon, 5 Nov 2018 at 15:26, nadim mansour wrote: > I have files that I need to transfer from my mac (machine) to windows > server and linux server before running several tasks > files are binary files and .exe > > can the files be sent through ftp

Re: [ansible-project] Question on using Ansible to upgrade Linux with config file overwrites

2018-11-05 Thread Dick Visser
On Mon, 5 Nov 2018 at 18:33, EspressoBeanies wrote: > > What's the best way to use Ansible to manage software updates where installer > config files have the potential to overwrite the config settings you > currently have in place? I'm trying to see if there's a way for Ansible to > apply