[ansible-project] Re: Failed to create new process - win_command

2018-12-04 Thread yyellapragada
Hey Jordan, but when I try the original command from within the remote machine, it works. It only fails when I run the command through Ansible. Do you still think the error might be with the installer? On Wednesday, December 5, 2018 at 2:07:34 PM UTC+11, Jordan Borean wrote: > > So the error yo

[ansible-project] Re: Failed to create new process - win_command

2018-12-04 Thread Jordan Borean
So the error you are getting now is not an issue trying to access the file but a problem with the installer itself. This means you have solved the original issue but are now coming across another issue that is related to the program you are trying to install. I very much doubt that you need to

Re: [ansible-project] Re: Using "shell" with a switch

2018-12-04 Thread Piotr Owcarz
Karl, Yeah, I have already noticed that some people act like they learned internet forums yesterday. I feel totally noob now, but what do you do if the question is within within your grasp, but you lack a little information? Piotr wt., 4 gru 2018 o 23:26 Karl Auer napisał(a): > Hullo Piotr.

Re: [ansible-project] Re: Using "shell" with a switch

2018-12-04 Thread Karl Auer
Hullo Piotr. No, it's just that people very often do not post their entire playbook or the complete output from their runs. This it often misleads responders, who go down various dead ends before finally requesting that the OP post *everything*, then at last the problem gets resolved. In a long th

Re: [ansible-project] Re: Using "shell" with a switch

2018-12-04 Thread Piotr Owcarz
Kai, What are you trying to say? Are there limits to thread lenght in this group? I recenty posted a question in another thread and noticed, that this mail group is seriously lacking involvment, which I totally get - people asking trivial questions don't deserve expert's answers, I totally get it.

[ansible-project] Re: Using "shell" with a switch

2018-12-04 Thread Dimitri Yioulos
Piotr, Well, not quite. It's true that Bind isn't installed on the host in which the script is installed and runs. If I run the script from there, after su'ing to root, it works fine. But, why doesn't the script execute from Ansible as written - running rndc on the dns servers that are identi

Re: [ansible-project] Re: Using "shell" with a switch

2018-12-04 Thread Kai Stian Olstad
On Tuesday, 4 December 2018 21:48:17 CET Dimitri Yioulos wrote: > Piotr, > > Fair enough. And, I do appreciate you sticking with this. > > Output of "echo $PATH": > > /usr/kerberos/sbin:/usr/kerberos/bin:/usr/bin:/bin > > Output of "which rndc": > > /usr/bin/which: no rndc in > (/usr/kerbero

Re: [ansible-project] Re: Using "shell" with a switch

2018-12-04 Thread Kai Stian Olstad
On Tuesday, 4 December 2018 22:24:21 CET sateesh s wrote: > I am trying to setup communication between ansible and a windows server > which is hosted in virtual machine manager. Do any one know about it. > > I am getting error like > Bad HTTP response from server . Code 404 > > Thanks in advance

Re: [ansible-project] Roles Concept in ansible 2.7 version

2018-12-04 Thread sateesh s
Hi, I am trying to setup communication between ansible and a windows server which is hosted in virtual machine manager. I set host file and trying to communicate through basic authentication. I have open the ports 5985 And allowedunecrypted : true Do any one know about it. I am getting error l

Re: [ansible-project] Re: Using "shell" with a switch

2018-12-04 Thread sateesh s
Hi, I am trying to setup communication between ansible and a windows server which is hosted in virtual machine manager. Do any one know about it. I am getting error like Bad HTTP response from server . Code 404 Thanks in advance On Tue, Dec 4, 2018 at 4:21 PM Piotr Owcarz wrote: > Hi > > /usr

Re: [ansible-project] Re: Using "shell" with a switch

2018-12-04 Thread Piotr Owcarz
Hi /usr/bin/which: no rndc in > (/usr/kerberos/sbin:/usr/kerberos/bin:/usr/bin:/bin) <-- not a surprise; > BIND isn't installed on this machine > So, do you already know what the problem is? Are you executing rndc on remote host but you dont have BIND installed on it? wt., 4 gru 2018 o 21:48 D

[ansible-project] Re: Using "shell" with a switch

2018-12-04 Thread Dimitri Yioulos
Piotr, Fair enough. And, I do appreciate you sticking with this. Output of "echo $PATH": /usr/kerberos/sbin:/usr/kerberos/bin:/usr/bin:/bin Output of "which rndc": /usr/bin/which: no rndc in (/usr/kerberos/sbin:/usr/kerberos/bin:/usr/bin:/bin) <-- not a surprise; BIND isn't installed on t

Re: [ansible-project] Re: Using "shell" with a switch

2018-12-04 Thread Piotr Owcarz
Dimitri Your script is depending on rndc residing in the host's $PATH. It might happen, that the root's profile is being set differently when you become root in Ansible playbook, than the situation when are switching to root in a regular way in SSH or terminal. This is why I asked you for more info

[ansible-project] Fetch Credential name

2018-12-04 Thread Kash
1. Is it possible to fetch the credential name from tower_job_list module? [I am able to get the id, not the name] 2. I am using tower_job_list module to fetch the details of the running job.Is there another way to fetch the running job's details? Our goal is to start multiple jobs with dif

[ansible-project] Re: Using "shell" with a switch

2018-12-04 Thread Dimitri Yioulos
Piotr, The thing of it is, the script (which I didn't write) runs the rndc (BIND Remote Name Daemon Control - we use it to reload zone files) command on our dns servers (which it locates), not on the host in which the script is located. Thus, the failure. Here's a snippet from the script:

Re: [ansible-project] Re: run tasks based on variable

2018-12-04 Thread Piotr Owcarz
Depends on what you actually want to do. wt., 4 gru 2018 o 20:32 Bill Nolf napisał(a): > How > > On Tue, Dec 4, 2018 at 2:31 PM Piotr Owcarz wrote: > >> Yes >> >> >> wt., 4 gru 2018 o 20:03 Bill Nolf napisał(a): >> >>> Ansible 2.4 >>> >>> On Tuesday, December 4, 2018 at 2:03:21 PM UTC-5, Bill

Re: [ansible-project] Re: run tasks based on variable

2018-12-04 Thread Bill Nolf
How On Tue, Dec 4, 2018 at 2:31 PM Piotr Owcarz wrote: > Yes > > > wt., 4 gru 2018 o 20:03 Bill Nolf napisał(a): > >> Ansible 2.4 >> >> On Tuesday, December 4, 2018 at 2:03:21 PM UTC-5, Bill Nolf wrote: >>> >>> I have the following vars: >>> >>> vms >>> test1 >>> name: test1 >>>

Re: [ansible-project] Re: run tasks based on variable

2018-12-04 Thread Piotr Owcarz
Yes wt., 4 gru 2018 o 20:03 Bill Nolf napisał(a): > Ansible 2.4 > > On Tuesday, December 4, 2018 at 2:03:21 PM UTC-5, Bill Nolf wrote: >> >> I have the following vars: >> >> vms >> test1 >> name: test1 >> disk_size: >>- size: 10 >>- size: 20 >> >>

Re: [ansible-project] Re: Using "shell" with a switch

2018-12-04 Thread Piotr Owcarz
Dimitri The only resonable explanation is, that you have something with the PATH env variable (btw what is the remote OS?). Try this: 1. Login to remote machine and switch to root. Send me an output of 'echo $PATH' and 'which rndc' 2. run the same playbook with tasks: - shell: "'echo $PATH'" r

Re: [ansible-project] Roles Concept in ansible 2.7 version

2018-12-04 Thread Jordan Borean
Agreed, we’ve seen your playbook I want to see the output when running Ansible as that will tell us where the syntax issue is. -- 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,

[ansible-project] Re: run tasks based on variable

2018-12-04 Thread Bill Nolf
Ansible 2.4 On Tuesday, December 4, 2018 at 2:03:21 PM UTC-5, Bill Nolf wrote: > > I have the following vars: > > vms > test1 > name: test1 > disk_size: >- size: 10 >- size: 20 > > test2 > name: test2 > disk_size: > - s

[ansible-project] run tasks based on variable

2018-12-04 Thread Bill Nolf
I have the following vars: vms test1 name: test1 disk_size: - size: 10 - size: 20 test2 name: test2 disk_size: - size: 10 I need to be able to set tasks on test1 and then the same set on test2. Is there a way to do th

[ansible-project] Re: Using "shell" with a switch

2018-12-04 Thread Dimitri Yioulos
Piotr, After putting in the directives you mentioned, if I leave become_method: su and become_flags: '-' in the playbook, then the playbook is stuck/runs without completion. If I take those out, leaving only become: yes, then I get the following output: ok: [admin1] => { "who": {

Re: [ansible-project] Find all instances, and build a list

2018-12-04 Thread Kai Stian Olstad
On Tuesday, 4 December 2018 19:07:16 CET John Harmon wrote: > Thx Piotr. That works. I was hoping to be able to do this without shell, > but I haven't been able to find another way around it either. A lot more code. First use the slurp module to fetch the content and store it to a variable. Th

Re: [ansible-project] Find all instances, and build a list

2018-12-04 Thread Piotr Owcarz
Yeah, I've turned a full circle... Sorry, but I don't have a better solution... Piotr wt., 4 gru 2018 o 19:07 John Harmon napisał(a): > > > On Tuesday, December 4, 2018 at 11:04:15 AM UTC-7, Piotr Owcarz wrote: >> >> John, >> I just realized, that lookups read files on the Ansible control ma

Re: [ansible-project] Find all instances, and build a list

2018-12-04 Thread Kai Stian Olstad
On Tuesday, 4 December 2018 19:02:13 CET John Harmon wrote: > > On Tuesday, December 4, 2018 at 10:32:41 AM UTC-7, Kai Stian Olstad wrote: > > > > > > > > I find the error strange on the last one, because I stat the file > > previous > > > to it and can see it fine. > > > > In your set_fact,

Re: [ansible-project] Find all instances, and build a list

2018-12-04 Thread John Harmon
On Tuesday, December 4, 2018 at 11:04:15 AM UTC-7, Piotr Owcarz wrote: > > John, > I just realized, that lookups read files on the Ansible control machine. I > assume you are searching that file on remote machine - then lookup won't > work. If this is the case, read on... > I was researchnig a

Re: [ansible-project] Find all instances, and build a list

2018-12-04 Thread Piotr Owcarz
John, I just realized, that lookups read files on the Ansible control machine. I assume you are searching that file on remote machine - then lookup won't work. If this is the case, read on... I was researchnig a similar issue today, and couldn't came up with other solution than: - shell: "grep -Eo

Re: [ansible-project] Find all instances, and build a list

2018-12-04 Thread John Harmon
On Tuesday, December 4, 2018 at 10:32:41 AM UTC-7, Kai Stian Olstad wrote: > > On Tuesday, 4 December 2018 18:21:23 CET John Harmon wrote: > > Perhaps I am doing this wrong, but it doesn't like my syntax. If I > escape > > the backslash ('\\w+.img') it tries to run but with a different error:

Re: [ansible-project] Re: Using "shell" with a switch

2018-12-04 Thread Piotr Owcarz
Dimitri, Send us the output of the following (with become etc) - shell: "whoami" register: who - debug: var=who Also: login to remote machine, switch to root and run your script with -f switch. What output are you getting? What do you get when you run "which rndc" as root? Piotr wt., 4 gru

[ansible-project] Confusion about storing and accessing variables

2018-12-04 Thread Matt Hickok
Hello, I'm trying to store a cisco device config in the fact cache, I'm doing it like this: - name: "Get Config" register: config ios_command: commands: show running-config - name: "Store config as fact" set_fact: config: "{{ config.stdout }}" c

Re: [ansible-project] Find all instances, and build a list

2018-12-04 Thread Kai Stian Olstad
On Tuesday, 4 December 2018 18:21:23 CET John Harmon wrote: > Perhaps I am doing this wrong, but it doesn't like my syntax. If I escape > the backslash ('\\w+.img') it tries to run but with a different error: > - name: Find virtual Disks > set_fact: > virt_disks: "{{ lookup('fil

Re: [ansible-project] Find all instances, and build a list

2018-12-04 Thread John Harmon
Perhaps I am doing this wrong, but it doesn't like my syntax. If I escape the backslash ('\\w+.img') it tries to run but with a different error: - name: Find virtual Disks set_fact: virt_disks: "{{ lookup('file','/var/ftp/vm.cfg') | regex_findall('\w+.img') }}" Result: ERROR!

Re: [ansible-project] Re: Use id of AMI I have created as a variable in later tasks

2018-12-04 Thread Karl Auer
The line where you set new_ami_id, immediately below set_fact:, does not appear to be indented correctly. Indent it a few spaces and try again. Regards, K. On Wed, Dec 5, 2018 at 3:17 AM shaneoh1980 McP wrote: > This is the playbook: > > - hosts: webservers > remote_user: ubuntu > tasks: >

Re: [ansible-project] Re: Use id of AMI I have created as a variable in later tasks

2018-12-04 Thread Kai Stian Olstad
On Tuesday, 4 December 2018 17:17:37 CET shaneoh1980 McP wrote: > This is the playbook: > > - hosts: webservers > remote_user: ubuntu > tasks: > - name: create an ami > ec2_ami: > region: eu-west-2 > instance_id: i-077xxx > name: "{{ inventory_hostname

Re: [ansible-project] Re: Use id of AMI I have created as a variable in later tasks

2018-12-04 Thread shaneoh1980 McP
This is the playbook: - hosts: webservers remote_user: ubuntu tasks: - name: create an ami ec2_ami: region: eu-west-2 instance_id: i-077xxx name: "{{ inventory_hostname }}-{{ ansible_date_time.iso8601_basic_short }}" tags: Name: "{{

[ansible-project] Variable substitution in meta/main.yml

2018-12-04 Thread Lee Connell
Hi all, I am looking to use variable substitution in meta/main.yml and it doesn't seem to be working, at least on 2.4.2. Is this a supported feature in any of the newer versions? My use case is I have one "common" role that includes many roles that are common to a particular system. This allows

[ansible-project] Re: Using "shell" with a switch

2018-12-04 Thread Dimitri Yioulos
I thought that's what I should do. I made those changes, but then the playbook is stuck/runs without completion (until it ultimately times out, I'm guessing). On Monday, December 3, 2018 at 11:44:08 AM UTC-5, Dimitri Yioulos wrote: > > Hey, all. > > I need to run a script residing on the remote

Re: [ansible-project] Re: Use id of AMI I have created as a variable in later tasks

2018-12-04 Thread Karl Auer
On what line was that error thrown? I think you should provide the entire playbook and the complete output. Regards, K. On Wed, Dec 5, 2018 at 2:37 AM shaneoh1980 McP wrote: > I had actually tried that already, and when I do I get this error: > > "msg": "The task includes an option with an un

Re: [ansible-project] Re: Use id of AMI I have created as a variable in later tasks

2018-12-04 Thread shaneoh1980 McP
I accidentally replied to the email - haven't used Google Groups a lot, sorry about that. I had actually tried this already. When I do I get this error: "msg": "The task includes an option with an undefined variable. The error was: 'new_ami_id' is undefined\ Which is confusing because it see

Re: [ansible-project] Re: Using "shell" with a switch

2018-12-04 Thread Kai Stian Olstad
On Tuesday, 4 December 2018 16:35:09 CET Dimitri Yioulos wrote: > Sorry, Kai, I'm not understanding what the playbook should look like. I'm > a bit slow on the uptake. - hosts: all gather_facts: false become: yes become_method: su become_flags: '-' tasks: - shell: /scripts/dnscopy

Re: [ansible-project] Re: Use id of AMI I have created as a variable in later tasks

2018-12-04 Thread shaneoh1980 McP
I had actually tried that already, and when I do I get this error: "msg": "The task includes an option with an undefined variable. The error was: 'new_ami_id' is undefined\ Which is confusing because it seems to me it clearly is being defined. On Tue, 4 Dec 2018 at 15:26, Karl Auer wrote: > Yo

[ansible-project] Re: Using "shell" with a switch

2018-12-04 Thread Dimitri Yioulos
Sorry, Kai, I'm not understanding what the playbook should look like. I'm a bit slow on the uptake. On Monday, December 3, 2018 at 11:44:08 AM UTC-5, Dimitri Yioulos wrote: > > Hey, all. > > I need to run a script residing on the remote machine with a switch, as in > "/scripts/myscript -f" (it

Re: [ansible-project] Re: Using "shell" with a switch

2018-12-04 Thread Kai Stian Olstad
On Tuesday, 4 December 2018 16:10:48 CET Dimitri Yioulos wrote: > Thanks, Kai. > > Now, I'm completely turned around. > > In order for /scripts/dnscopy.pl -f to work in the remote host itself, I > must su - root first. I thought that become: yes took care of that. > Here's the playbook as it

Re: [ansible-project] Re: Use id of AMI I have created as a variable in later tasks

2018-12-04 Thread Karl Auer
You need to wrap wrap the variable up in curly braces so that it is interpreted rather than taken literally. I.e., where you have: new_ami_id: ami.results[0].image_id you need: new_ami_id: "{{ ami.results[0].image_id }}" Regards, K. On Wed, Dec 5, 2018 at 2:14 AM shaneoh1980 McP wrote: > Afte

[ansible-project] Re: Use id of AMI I have created as a variable in later tasks

2018-12-04 Thread shaneoh1980 McP
After more searching I also tried this: --- - hosts: webservers remote_user: ubuntu tasks: - name: create an ami ec2_ami: region: eu-west-2 instance_id: i-0771xx name: "{{ inventory_hostname }}-{{ ansible_date_time.iso8601_basic_short }}" tags

[ansible-project] Re: Using "shell" with a switch

2018-12-04 Thread Dimitri Yioulos
Thanks, Kai. Now, I'm completely turned around. In order for /scripts/dnscopy.pl -f to work in the remote host itself, I must su - root first. I thought that become: yes took care of that. Here's the playbook as it stands (and fails) now: --- - hosts: all gather_facts: false become: yes

Re: [ansible-project] Using Ansible to setup newly installed Ubuntu-box, no ssh

2018-12-04 Thread Kai Stian Olstad
On Tuesday, 4 December 2018 14:32:03 CET Sorin Srbu wrote: >1. I order and buy a bunch of Dell laptops with Ubuntu 16 LTS >preinstalled. > >2. I manually go trough the first-install-config. > >3. After reboot, it's up, and I want to use Ansible from a remote >admin-com

Re: [ansible-project] Re: Using "shell" with a switch

2018-12-04 Thread Kai Stian Olstad
On Tuesday, 4 December 2018 15:38:03 CET Dimitri Yioulos wrote: > Before I consider this solved, let me push the envelope a bit, and ask > about the switch. If I run the play like this: > > Shell: /scripts/myscript > > it works. > > If I run it like this: > > Shell: /scripts/myscript -f > >

[ansible-project] Re: Using "shell" with a switch

2018-12-04 Thread Dimitri Yioulos
Piotr, Before I consider this solved, let me push the envelope a bit, and ask about the switch. If I run the play like this: Shell: /scripts/myscript it works. If I run it like this: Shell: /scripts/myscript -f it fails with: fatal: [admin1]: FAILED! => {"changed": true, "cmd": "/scripts/d

Re: [ansible-project] Using Ansible to setup newly installed Ubuntu-box, no ssh

2018-12-04 Thread Jonathan Lozada De La Matta
well that's an option but, what I was getting is that either you either get ssh installed somehow or try ansible-pull. On Tue, Dec 4, 2018 at 9:08 AM Sorin Srbu wrote: > Hi and thanks for the reply. > > In the installer wizard, like a role picker as in eg CentOS? > Not that I noticed. > > I got

Re: [ansible-project] Using Ansible to setup newly installed Ubuntu-box, no ssh

2018-12-04 Thread Sorin Srbu
Hi and thanks for the reply. In the installer wizard, like a role picker as in eg CentOS? Not that I noticed. I got to choose keyboard, language, time zone and if I wanted to use wifi. Also asked if I wanted to create a rescue usb-stick. Nothing else that I recall. I'm getting to think maybe I

[ansible-project] Re: Using "shell" with a switch

2018-12-04 Thread Dimitri Yioulos
Thank you, Piotr. All good, now. You're right, and this is a mistake I shouldn't have made, given my long history with Ansible. But, hey, never too late to learn. Thanks, again. On Monday, December 3, 2018 at 11:44:08 AM UTC-5, Dimitri Yioulos wrote: > > Hey, all. > > I need to run a script

Re: [ansible-project] Using Ansible to setup newly installed Ubuntu-box, no ssh

2018-12-04 Thread Jonathan Lozada De La Matta
during step 2 is there an option to install extra packages or do extra commands? On Tue, Dec 4, 2018 at 8:32 AM Sorin Srbu wrote: > Hi all, > > It goes like this. > > >1. I order and buy a bunch of Dell laptops with Ubuntu 16 LTS >preinstalled. > >2. I manually go trough the first-in

[ansible-project] Using Ansible to setup newly installed Ubuntu-box, no ssh

2018-12-04 Thread Sorin Srbu
Hi all, It goes like this. 1. I order and buy a bunch of Dell laptops with Ubuntu 16 LTS preinstalled. 2. I manually go trough the first-install-config. 3. After reboot, it's up, and I want to use Ansible from a remote admin-computer to set the laptop up identically for

Re: [ansible-project] Ansible playbook to check disk space is failing

2018-12-04 Thread Piotr Owcarz
Hi Ok, I think I know what you're doing here. ansible_mounts is an ansible fact - a magi variable defined by Ansible during runtime, but you are instructing Ansible not to gater facts with gather_facts: no, that's why Ansible can not recognize the ansible_mounts variable, so remove the "gather_fa

[ansible-project] Use id of AMI I have created as a variable in later tasks

2018-12-04 Thread shaneoh1980 McP
I am trying to create a playbook which does the following: - creates an image of an AWS instance - copies the image to a different region - installs updates to the instance I can do all of this apart from getting the AMI to copy to a different region. I've tried a few things but this

[ansible-project] Ansible development modules documentation

2018-12-04 Thread 'Rajas Pachipulusu' via Ansible Project
Hi Experts, Can some one point me to a link where I can find good documentation on unit testing of developed ansible modules. Ansible documentation is not so clear. Thanks, Rajas -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscr

Re: [ansible-project] Re: The installed version of WinRM does not support transport(s) [u'']

2018-12-04 Thread ameya agashe
Thank you, Jordan! Yep, it was empty instead of basic. My bad. Kind Regards, Ameya Agashe On Tue, Dec 4, 2018 at 5:42 PM Jordan Borean wrote: > It sounds like you have the variable 'ansible_winrm_transport' defined to > an empty string. > > Thanks > > Jordan > > -- > You received this message b

Re: [ansible-project] Ansible playbook to check disk space is failing

2018-12-04 Thread anushakeshipeddy4
Hi Piotr, Thank you for your quick response. I am trying to check if the available disk space is greater than 30% and declared mounts as variables but still it is failing. COuld you please help. Playbook.yml --- - hosts: all gather_facts: no vars_files: - /etc/ansible/xyz/pre-deploy/v

Re: [ansible-project] Roles Concept in ansible 2.7 version

2018-12-04 Thread Jonathan Lozada De La Matta
I would check the role called san and verify that the spacing for the block is correct. Look at the ansible documentation for an example of a block. On Mon, Dec 3, 2018 at 11:53 PM VJ49 wrote: > [image: error2.PNG] > Hi, This is the code.. Have a look... > > On Monday, December 3, 2018 at 11:32:

Re: [ansible-project] Ansible playbook to check disk space is failing

2018-12-04 Thread Piotr Owcarz
Hi You are declaring ansible_mounts as a list of strings. It literally is: ansible_mounts: ['xyz', 'abc']. Ansible is complaining, that the string 'xyz' does not have a 'mount' property. You are obviously missing a step, where you actually check the available space :) Piotr wt., 4 gru 2018 o

Re: [ansible-project] Declare variable user created with limits

2018-12-04 Thread Piotr Owcarz
Hi It's hard to get what your goal is... You mean something like this? struct : users: - name: user1 uid: 2001 shell: /bin/sh group: grp1 groups: grp2 home: /home/user1 limits: - { type: soft, item: nofile, value: 65536} - { type: soft, item: nofil