[ansible-project] Re: Ansible windows modules

2016-02-23 Thread Quang Truong
Jon,

I have tried with win_package, as .NET framework 4.5 can not be uninstalled 
so I just grab a fake product_id (not sure for the other but for me, I'm 
using ansible 1.9.3 and product_id param should be *productid* without 
dash) and the results are the same as using raw command. If I use the 
offline package then receive error 16389 and use the web package then the 
installation runs in middle then stop with error 5. Still no luck so far.

I will try to upgrade to 2.0 then use win_acl to overcome the error 5 or 
win_webpicmd. 


Stavros,

I can run the installation without ansible for offline package (copy this 
package into the remote machine):
- Use powershell to call on the remote machine
- Use paexec and call the exe from remote

Thank you for your update.

-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/5606d671-e769-4534-b48f-20b947a89b9e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: win_package product_id

2016-02-23 Thread Gerald Spencer
It is: 

Python 3.5 64bit
https://www.continuum.io/downloads

-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/b4f2f197-e1a5-4859-bca8-211e053506ad%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] YAML variable without using quotes?

2016-02-23 Thread RobL
I'm still seeing a repro of the bug.  Is this the commit you're referring 
to?
https://github.com/ansible/ansible/pull/10465

For this bug?
https://github.com/ansible/ansible/issues/9362



On Thursday, February 18, 2016 at 8:59:36 AM UTC-8, Brian Coca wrote:
>
> that is a bug in that version, it should work on 2.0 and above
>
> On Thu, Feb 18, 2016 at 8:54 AM, RobL  
> wrote:
>
>> ansible 1.9.0.1
>>
>>
>> On Thursday, February 18, 2016 at 8:32:20 AM UTC-8, Brian Coca wrote:
>>>
>>> what version of ansible?
>>>
>>> On Thu, Feb 18, 2016 at 8:17 AM, RobL  wrote:
>>>
 No, I'm still seeing the value being quoted:

 instances: "{{ groups['workers']|count|int }}"
 becomes:
"instances": "3",


 On Thursday, February 18, 2016 at 8:03:02 AM UTC-8, Brian Coca wrote:
>
>  "{{foo|int}}" should return a number
>
>
> --
> 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-proje...@googlegroups.com.
 To post to this group, send email to ansible...@googlegroups.com.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/ansible-project/cf9c86d2-ade4-46a9-a8c4-0e04acbc7fe4%40googlegroups.com
  
 
 .

 For more options, visit https://groups.google.com/d/optout.

>>>
>>>
>>>
>>> -- 
>>> --
>>> 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-proje...@googlegroups.com .
>> To post to this group, send email to ansible...@googlegroups.com 
>> .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/ansible-project/9a6de5af-08af-4a4a-958d-b94ce77edca2%40googlegroups.com
>>  
>> 
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> --
> 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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/9321dfdc-895a-43ce-9883-7f15917b999f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] authorized_key module not working

2016-02-23 Thread Brian Coca
It does not need a key but it DOES need a way to login, normally
user/password if keys are not available.

The other option is a super user that already has access can copy the keys
for the specific users. Some cloud APIs allow for pushing a key through
alternate methods, this module does not know about that (look at cloud
specific modules for that).

​
--
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CACVha7f0Q%3DA5%3DVEiTMv7Htpazo2CWf-zDBg6jJT4H%3D-nTbi%3D3w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] authorized_key module not working

2016-02-23 Thread chrono
I've been looking at the - output and it doesn't really help.

I guess I should ask this question.. Does this module work for copying over 
the initial key?  Or does it only work if there is already an ssh-key set 
up for ansible to use?

On Tuesday, February 23, 2016 at 2:32:30 PM UTC-5, Dick Davies wrote:
>
> Try with '-' for starters, and compare with SSHing with the 
> servers directly. 
>
>
>
> On 23 February 2016 at 18:48, chrono  
> wrote: 
> > Hello, 
> > 
> > I wrote a playbook that checks out brand new servers that are built for 
> my 
> > team.  To make things truly one-and-done, I thought it would be clever 
> to 
> > include a play that copies the ssh public key from our ansible 
> controller to 
> > the freshly built remote hosts. 
> > 
> > I tried using the authorized_key module, but it doesn't seem to work.. 
> > 
> > Here is the play: 
> > 
> > --- 
> > - name: Checkout new build 
> >   hosts: all 
> >   remote_user: blah 
> >   tasks: 
> >   - name: copy ssh key to remote host 
> > authorized_key: 
> >   user: blah 
> >   key: "{{ lookup('file', '/home/blah/.ssh/id_rsa.pub') }}" 
> > 
> > 
> > Here is the error I get: 
> > 
> > TASK [setup] 
> > *** 
> > fatal: [hostname redacted]: UNREACHABLE! => {"changed": false, "msg": 
> > "ERROR! SSH encountered an unknown error during the connection. We 
> recommend 
> > you re-run the command using -, which will enable SSH debugging 
> output 
> > to help diagnose the issue", "unreachable": true} 
> > 
> > Here is the command I am running: 
> > 
> > ansible-playbook -i /home/blah/ansible/inventory/newBuilds.hosts 
> > /home/blah/ansible/playbooks/linuxCheckout/linuxCheckout.yml --ask-pass 
> > 
> > 
> > Am I doing something wrong? 
> > 
> > Best regards, 
> > 
> > -C 
> > 
> > -- 
> > 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-proje...@googlegroups.com . 
> > To post to this group, send email to ansible...@googlegroups.com 
> . 
> > To view this discussion on the web visit 
> > 
> https://groups.google.com/d/msgid/ansible-project/52be1e8d-ccec-4241-bc18-98e1ede7b77c%40googlegroups.com.
>  
>
> > For more options, visit https://groups.google.com/d/optout. 
>

-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/1c22cb8c-e86f-452c-a2d3-53cdad068199%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: synchronize sudo: effective uid is not 0, is /usr/bin/sudo on a file system with the 'nosuid' option set or an NFS file system without root privileges?

2016-02-23 Thread Gary Morse
for anyone finding this, here's how i solved it. 

The issue is that the synchronize task tries to escalate to root on the 
tower machine, not on the target host. Since awx user doesnt have sudo 
permissions, it fails. 

to fix this, set sudo to "no" on the task and specify the rsync_path as 
"sudo rsync". This will ensure it doesnt sudo on the tower machine. 

- name: copy source to host directory
  synchronize: src=../../../src/ dest=/var/www/aaa-newsletter-builder 
times=no perms=no group=no rsync_path="sudo rsync"
  sudo: no

On Tuesday, February 23, 2016 at 1:26:27 PM UTC-5, Gary Morse wrote:
>
> after upgrading to ansible 2.0 i am getting an error when trying to 
> synchronize a directory to a remote server. Ansible version: 2.0.0.2
>
> The entire playbook runs with sudo:yes, but the error only happens on the 
> synchronize module. does anyone have have an idea or places to look to 
> resolve my issue?
>
> I switched from synchronize to copy and everything works, but obviously 
> very slow. 
>
> ---
> - name: copy source to host directory
>   synchronize: >
> src=../../../src/
> dest=/var/www/aaa-newsletter-builder
> times=no
> perms=no
> group=no
>
>
> {
>   "_ansible_no_log": false,
>   "module_stderr": "sudo: effective uid is not 0, is /usr/bin/sudo on a file 
> system with the 'nosuid' option set or an NFS file system without root 
> privileges?\n",
>   "changed": false,
>   "module_stdout": "",
>   "failed": true,
>   "parsed": false,
>   "msg": "MODULE FAILURE",
>   "play": "build email builder",
>   "task": "TASKNAME : copy source to host directory",
>   "role": "ROLENAME",
>   "ignore_errors": null,
>   "status": "failed",
>   "module_name": "synchronize",
>   "module_args": "",
>   "created": "2016-02-23T15:09:08.183Z",
>   "host_id": 10,
>   "host_name": "REDACTED",
>   "id": 22370,
>   "parent": 22369,
>   "event": "Host Failed"
> }
>
>
>
-- 
 

This communication (including all attachments) is intended solely for the 
use of the person(s) to whom it is addressed and should be treated as 
a confidential AAA communication.  If you are not the intended recipient, 
any use, distribution, printing, or copying of this email is strictly 
prohibited.  If you received this email in error, please immediately delete 
it from your system and notify the originator.  Your cooperation is 
appreciated.

-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/639abe3b-64d2-4e4f-a5bb-541ed6153142%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: Ansible 2.0.1 RC2 is available for testing

2016-02-23 Thread James Cammarata
Sorry for not seeing your response before. The release was held up a bit by
AnsibleFest, but we should be getting it out tomorrow.

Thanks!

James Cammarata
Director, Ansible Core Engineering
github: jimi-c

On Tue, Feb 16, 2016 at 4:36 PM, Slim Slam  wrote:

> Any rough estimate on a release date?
>
> J
>
>
> On Monday, February 15, 2016 at 3:12:02 PM UTC-6, James Cammarata wrote:
>>
>> Hi all, we're happy to announce the RC2 release candidate for Ansible
>> 2.0.1 is available and ready for testing. This RC2 continues to address
>> bugs found in the 2.0 release.
>>
>> How do you get it?
>> --
>>
>> The tar.gz of the release can be found here:
>>
>> http://releases.ansible.com/ansible/ansible-2.0.1.0-0.2.rc2.tar.gz
>> SHA256: 4807f8e4b6c70ea1eca6bb3131c19e17d835d2e8884a63d107a842007430285a
>>
>> You can also test against the git repository as follows:
>>
>> $ git clone https://github.com/ansible/ansible.git
>> $ cd ansible
>> $ git checkout v2.0.1.0-0.2.rc2
>> $ git submodule update --init
>>
>> You can then source our testing script:
>>
>> $ . hacking/env-setup
>>
>> or you can build your own .tar.gz (output will be dist/ansible-2.0.1
>> .0.tar.gz):
>>
>> $ make sdist
>>
>> If you discover any errors, or if you see any regressions from playbooks
>> which work on 1.9.x and prior, please open a Github issue and be sure to
>> mention you're testing against this release candidate.
>>
>> Thanks!
>>
>> James Cammarata
>> Ansible Project Lead
>> github: jimi-c
>>
> --
> 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 to this group, send email to ansible-project@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/daf3cde9-14b1-40bc-90d1-415c3c14a4d7%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAMFyvFhuyuJtvk%2B2-WMdUuJ5eWnGERH2aGibhDgQARso33tPbg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Ansible Inventory - Groups by Regular Expression?

2016-02-23 Thread Brian Coca
no, but the patterns do work in host expressions (hosts: ~.*-GB$ , --limit
'~*-US$')


--
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CACVha7f8wKsWj%3DAEAuZ%3D-y8AYdUxuPU02qhtCuzJrX%2BAP%3DHPgQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Use ec2_remote_facts in another playbook

2016-02-23 Thread Colin Byrne
So the ec2_remote_facts has been great at getting the facts, but because it 
has to run against localhost, I have to run it as a separate play and can't 
use the registered information in a play run against other hosts. How can I 
transfer that registered variable to the new play/different hosts? The 
module seems fairly useless if you can't access that information anywhere 
other than localhost... But I suspect I have overlooked a way to do this.

---
- name: find running instances
  hosts: localhost
  gather_facts: no
  tasks:
- ec2_remote_facts:
region: "{{ environment_settings['production'].region }}"
filters:
  "tag:Environment": production
  register: production_server_facts
- debug: var=production_server_facts

- name: configure bastion servers
  hosts: production_bastion_servers
  become: yes
  become_method: sudo
  roles:
- hostname
- common
- ufw
#- sudoers
- users_and_groups
- hosts_file
- ssh

Thanks for any help, it is greatly appreciated!

-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/474c5533-a368-44b8-9b89-ca0b91930593%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] authorized_key module not working

2016-02-23 Thread Dick Davies
Try with '-' for starters, and compare with SSHing with the
servers directly.



On 23 February 2016 at 18:48, chrono  wrote:
> Hello,
>
> I wrote a playbook that checks out brand new servers that are built for my
> team.  To make things truly one-and-done, I thought it would be clever to
> include a play that copies the ssh public key from our ansible controller to
> the freshly built remote hosts.
>
> I tried using the authorized_key module, but it doesn't seem to work..
>
> Here is the play:
>
> ---
> - name: Checkout new build
>   hosts: all
>   remote_user: blah
>   tasks:
>   - name: copy ssh key to remote host
> authorized_key:
>   user: blah
>   key: "{{ lookup('file', '/home/blah/.ssh/id_rsa.pub') }}"
>
>
> Here is the error I get:
>
> TASK [setup]
> ***
> fatal: [hostname redacted]: UNREACHABLE! => {"changed": false, "msg":
> "ERROR! SSH encountered an unknown error during the connection. We recommend
> you re-run the command using -, which will enable SSH debugging output
> to help diagnose the issue", "unreachable": true}
>
> Here is the command I am running:
>
> ansible-playbook -i /home/blah/ansible/inventory/newBuilds.hosts
> /home/blah/ansible/playbooks/linuxCheckout/linuxCheckout.yml --ask-pass
>
>
> Am I doing something wrong?
>
> Best regards,
>
> -C
>
> --
> 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 to this group, send email to ansible-project@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/52be1e8d-ccec-4241-bc18-98e1ede7b77c%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAK5eLPT%2B5OKaFTL5sgYb%2BjZ70G6oQkDN43jKQHg5ahGc24ndcA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: using register stdout_lines in with_items loop

2016-02-23 Thread Matt Martz
The "problem" is in how ansible registers results when using with_items.
It nests all of the results inside of a `results` key

Your second task could have been written to use:

- name: use shell to print list of file paths
  shell: "echo {{ item }}"
  with_items: "{{ files.results|map(attribute='stdout_lines')|list }}"

That would do it for you.  That pulls the `stdout_lines` attribute out into
a list of `stdout_lines`, then with_items natively handles the flattening,
allowing you to loop over each individual item in the `ls` output.

There is some documentation about using register with a loop, which you can
find at
http://docs.ansible.com/ansible/playbooks_loops.html#using-register-with-a-loop

On Tue, Feb 23, 2016 at 12:51 PM, Jason Gilfoil  wrote:

> So after some testing and reading i'm gonna attempt to answer my own
> question, and pose another one.
>
> The documentation I cited for iterating the results of a program execution
> didn't involve the use of with_items in the original program execution.
> Having multiple results in a register variable doesn't seem to play nice
> with 'with_items'.
>
> I decided to work around the issue by having multiple tasks to gather the
> file names and iterate over each result in the replace module.
>
> As a corollary to that, when using with_items and setting a failed_when
> condition, you can't seem to use the 'rc' property of the register variable
> in a task because the rc code only exists if the task fails. I'm thinking
> there must be a way to say fail_when: the register.rc exists, but haven't
> figured that part out yet.
>
>
> On Monday, February 22, 2016 at 10:19:47 AM UTC-5, Jason Gilfoil wrote:
>>
>> Hello All,
>>
>> I'm ultimately attempting to pull a list of files with wildcarded paths
>> and pass the results into the replace module so it can cycle through them
>> all. However, starting with a more simple example, i'm having issues
>> getting the list of files to print properly in even a simple test case.
>>
>>
>> Pastebin code:
>> http://pastebin.com/zFRzucat
>>
>> I'm looking for this:
>>
>> test.yml playbook
>>
>> - hosts: all
>>   tasks:
>> - name: gather list of files
>>   shell: ls {{ item }}
>>   register: files
>>   with_items:
>> - /app/psoft/test/*/list.txt
>> - /app/psoft/test/*/context.xml
>>
>> - name: use shell to print list of file paths
>>   shell: "echo {{ item }}"
>>   with_items: "{{files.stdout_lines}}"
>>
>>
>> to print
>>
>> /app/psoft/test/12.1.2.00/list.txt
>> /app/psoft/test/12.1.3.00/context.xml
>>
>> However currently the result is:
>>
>> TASK [gather list of files]
>> 
>> changed: [net12204] => (item=/app/psoft/test/*/list.txt)
>> changed: [net12204] => (item=/app/psoft/test/*/context.xml)
>>
>> TASK [use shell to print list of file paths]
>> ***
>> [DEPRECATION WARNING]: Skipping task due to undefined attribute, in the
>> future this will be a fatal error.. This feature will
>> be removed in a future release. Deprecation warnings can be disabled by
>> setting deprecation_warnings=False in ansible.cfg.
>>
>>
>> Am I misusing or not understanding
>> http://docs.ansible.com/ansible/playbooks_loops.html#iterating-over-the-results-of-a-program-execution
>> properly?
>>
>>
>> Thanks!
>> Jason
>>
>> --
> 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 to this group, send email to ansible-project@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/82ae7301-06d6-42e9-a4f3-cf017f09ed22%40googlegroups.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Matt Martz
@sivel
sivel.net

-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAD8N0v-_iuDcNNvFmNcAkhUrb_uZgfgDsWfnk_BzUn-f0d%3D%2BSw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: using register stdout_lines in with_items loop

2016-02-23 Thread Jason Gilfoil
So after some testing and reading i'm gonna attempt to answer my own 
question, and pose another one.

The documentation I cited for iterating the results of a program execution 
didn't involve the use of with_items in the original program execution. 
Having multiple results in a register variable doesn't seem to play nice 
with 'with_items'. 

I decided to work around the issue by having multiple tasks to gather the 
file names and iterate over each result in the replace module.

As a corollary to that, when using with_items and setting a failed_when 
condition, you can't seem to use the 'rc' property of the register variable 
in a task because the rc code only exists if the task fails. I'm thinking 
there must be a way to say fail_when: the register.rc exists, but haven't 
figured that part out yet.


On Monday, February 22, 2016 at 10:19:47 AM UTC-5, Jason Gilfoil wrote:
>
> Hello All,
>
> I'm ultimately attempting to pull a list of files with wildcarded paths 
> and pass the results into the replace module so it can cycle through them 
> all. However, starting with a more simple example, i'm having issues 
> getting the list of files to print properly in even a simple test case.
>
>
> Pastebin code:
> http://pastebin.com/zFRzucat
>
> I'm looking for this:
>
> test.yml playbook
>  
> - hosts: all
>   tasks:
> - name: gather list of files
>   shell: ls {{ item }}
>   register: files
>   with_items:
> - /app/psoft/test/*/list.txt
> - /app/psoft/test/*/context.xml
>  
> - name: use shell to print list of file paths
>   shell: "echo {{ item }}"
>   with_items: "{{files.stdout_lines}}"
>
>
> to print
>
> /app/psoft/test/12.1.2.00/list.txt
> /app/psoft/test/12.1.3.00/context.xml
>
> However currently the result is:
>
> TASK [gather list of files] 
> 
> changed: [net12204] => (item=/app/psoft/test/*/list.txt)
> changed: [net12204] => (item=/app/psoft/test/*/context.xml)
>
> TASK [use shell to print list of file paths] 
> ***
> [DEPRECATION WARNING]: Skipping task due to undefined attribute, in the 
> future this will be a fatal error.. This feature will
> be removed in a future release. Deprecation warnings can be disabled by 
> setting deprecation_warnings=False in ansible.cfg.
>
>
> Am I misusing or not understanding 
> http://docs.ansible.com/ansible/playbooks_loops.html#iterating-over-the-results-of-a-program-execution
>  
> properly?
>
>
> Thanks!
> Jason
>
>

-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/82ae7301-06d6-42e9-a4f3-cf017f09ed22%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] authorized_key module not working

2016-02-23 Thread chrono
Hello,

I wrote a playbook that checks out brand new servers that are built for my 
team.  To make things truly one-and-done, I thought it would be clever to 
include a play that copies the ssh public key from our ansible controller 
to the freshly built remote hosts.

I tried using the authorized_key module, but it doesn't seem to work..

Here is the play:

---
- name: Checkout new build
  hosts: all
  remote_user: blah
  tasks:
  - name: copy ssh key to remote host
authorized_key:
  user: blah
  key: "{{ lookup('file', '/home/blah/.ssh/id_rsa.pub') }}"


Here is the error I get:

TASK [setup] 
***
fatal: [hostname redacted]: UNREACHABLE! => {"changed": false, "msg": 
"ERROR! SSH encountered an unknown error during the connection. We 
recommend you re-run the command using -, which will enable SSH 
debugging output to help diagnose the issue", "unreachable": true}

Here is the command I am running:

ansible-playbook -i /home/blah/ansible/inventory/newBuilds.hosts 
/home/blah/ansible/playbooks/linuxCheckout/linuxCheckout.yml --ask-pass


Am I doing something wrong?

Best regards,

-C

-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/52be1e8d-ccec-4241-bc18-98e1ede7b77c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] synchronize sudo: effective uid is not 0, is /usr/bin/sudo on a file system with the 'nosuid' option set or an NFS file system without root privileges?

2016-02-23 Thread Gary Morse
after upgrading to ansible 2.0 i am getting an error when trying to 
synchronize a directory to a remote server. Ansible version: 2.0.0.2

The entire playbook runs with sudo:yes, but the error only happens on the 
synchronize module. does anyone have have an idea or places to look to 
resolve my issue?

I switched from synchronize to copy and everything works, but obviously 
very slow. 

---
- name: copy source to host directory
  synchronize: >
src=../../../src/
dest=/var/www/aaa-newsletter-builder
times=no
perms=no
group=no


{
  "_ansible_no_log": false,
  "module_stderr": "sudo: effective uid is not 0, is /usr/bin/sudo on a file 
system with the 'nosuid' option set or an NFS file system without root 
privileges?\n",
  "changed": false,
  "module_stdout": "",
  "failed": true,
  "parsed": false,
  "msg": "MODULE FAILURE",
  "play": "build email builder",
  "task": "TASKNAME : copy source to host directory",
  "role": "ROLENAME",
  "ignore_errors": null,
  "status": "failed",
  "module_name": "synchronize",
  "module_args": "",
  "created": "2016-02-23T15:09:08.183Z",
  "host_id": 10,
  "host_name": "REDACTED",
  "id": 22370,
  "parent": 22369,
  "event": "Host Failed"
}



-- 
 

This communication (including all attachments) is intended solely for the 
use of the person(s) to whom it is addressed and should be treated as 
a confidential AAA communication.  If you are not the intended recipient, 
any use, distribution, printing, or copying of this email is strictly 
prohibited.  If you received this email in error, please immediately delete 
it from your system and notify the originator.  Your cooperation is 
appreciated.

-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/30943597-38e3-4107-9d19-4f0c342405b3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] 'unsupported parameter for module: notify' error when trying to call notify from a task

2016-02-23 Thread Colin Anderson
Aah yes, that did the trick; lesson learned. Thanks.

Colin.

On Saturday, 20 February 2016 16:41:24 UTC, Matt Martz wrote:
>
> `notify` is indeed not a parameter of the `template` module.
>
> Effectively this error is stating that you have indented your `notify` too 
> far.  It should be directly aligned with `template` and `name` and not 
> nested under `template`
>
> On Friday, February 19, 2016, Colin Anderson  > wrote:
>
>> Hi,
>>
>> I'm trying to run a playbook that installs and restarts a tomcat instance 
>> but when I run it it fails with the following message:
>>
>> TASK [tomcat-datagateway : Configure the tomcat-datagateway server.xml] 
>> 
>> fatal: [10.10.1.3]: FAILED! => {"changed": true, "failed": true, "msg": 
>> "unsupported 
>> parameter for module: notify"}
>>
>>
>> I have the following layout for the tomcat-datagateway role:
>>
>> roles/tomcat-datagateway/
>>   files/
>> tomcat-datagateway (environment script)
>> tomcat-datagateway.sh (init.d script)
>>   handlers/
>> main.yml
>>   tasks/
>> main.yml
>>   templates/
>> server.xml
>> tomcat-users.xml
>>   vars/
>> main.yml
>>
>>
>> The relevant part of the tasks/main.yml looks like this (everything up 
>> until this point works fine):
>> - name: Configure the tomcat-datagateway server.xml
>>   template:
>> src: server.xml
>> dest: /home/apiproc/tomcat-datagateway/apache-tomcat-8.0.32/conf
>> notify: restart tomcat-datagateway
>>
>>
>> The handlers/main.yml looks like this:
>> ---
>> - name: restart tomcat-datagateway
>>   service: name=tomcat-datagateway state=restarted
>>
>> I'm quite new to Ansible so I was wondering if I've missed something out 
>> perhaps? 
>>
>> Thanks,
>> Colin.
>>
>> -- 
>> 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 to this group, send email to ansible-project@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/ansible-project/6ebd6231-4a94-47ba-99a4-c01cb58a9379%40googlegroups.com
>>  
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
> -- 
> Matt Martz
> @sivel
> sivel.net
>
>

-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/956683f7-7800-472a-9ffc-167d502847a7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Galaxy 2.0.1 Release

2016-02-23 Thread Chris Houseknecht
We will be releasing Galaxy  2.0.1 this Friday 
2/26 starting at 7:30AM EST and ending at 8:00AM EST. During this window 
access to Galaxy may be interrupted, so please plan accordingly.


--Chris


Chris Houseknecht
Lead Galaxy Engineer
@chouseknecht 
RedHat | Ansible 

-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/5ac6571b-fa73-4d84-9143-dc4fa79ef57e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Galaxy Maintenance Window 2/25 7:30AM EST

2016-02-23 Thread Chris Houseknecht
We will be performing some network maintenance on Galaxy 
 this Thursday 2/25 starting at 7:30AM EST and 
ending at 8:00AM EST. We will do our best to keep access to Galaxy 
uninterrupted during this window.

--Chris


Chris Houseknecht
Lead Galaxy Engineer
@chouseknecht 
RedHat | Ansible 

  

-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/93b5ea10-496a-4b7b-983d-57f6509e9fe6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Ansible windows modules

2016-02-23 Thread Stavros
The NDP452-KB2901907-x86-x64-AllOS-ENU.exe package contains the framework 
for various Windows versions. 
Have you tried to install it from the cli? E.g. start powershell as admin 
and try to install it?

In my case, I wrote a playbook in order to install it on a W2012R2 using 
ansible. Here an overview of the steps:
- copy this exe file to the remote host
- extract it
- in case of W2012R2 you will need the x64-Windows8.1-KB2934520-x64.msu, 
which you can install as next step
- finally the remote host has to be rebooted

Stavros

-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/7869a13f-cd85-43cc-ab55-94c257fa4afa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Simplest way to pass username & password to Git, when using http(s)?

2016-02-23 Thread Toshio Kuratomi
On Feb 20, 2016 8:35 AM, "eric via Ansible Project" <
ansible-project@googlegroups.com> wrote:
>
> I'm using Ansible to clone / update a Git repository that I'm accessing
via HTTP, using username & password. Except that the "git" task really
doesn't help me.
>
> I can't put those credentials in the URL, because they then end up
stashed in the config of the git repository. That causes problems
downstream, including disclosure of the password to anyone else who has
access to the box, and if the password changes, failures in the Ansible
script.
>
> One work-around I came up with was the following:
>
> # set up the Git credential cache...
> - name: Set up credential cache
>   command: git config --global credential.helper cache
>
> # shove credentials into it...
> - name: Fetch git repositories
>   shell: printf 'protocol=http\nhost=git.example.com\nusername={{
username }}\npassword={{ password }}\n' | git credential approve ; if [ -d
reponame.git ]; then (cd reponame.git && git pull); else git clone http://{{
username }}@git.example.com/git/reponame reponame.git ; fi
>
> This works, but doesn't take care of various corner cases that the
Ansible "git" task does take care of. Also potentially puts the password in
the log file. Next approximation is to write the input to git credential
approve to a file, using the "template" task, but that leaves behind a file
I have to delete. So at that point, rather than using credential "cache",
use the "store".
>
>
> So I ended up with this:
>
>
> - name: Install temp file with personal git credentials
>   template: src="git_creds.txt.j2" dest="{{ ansible_env.HOME
}}/git_creds.txt" mode=0600
>
> - name: Approve credentials for Git.
>   command: /bin/bash -c "git config --global credential.helper store; cat
git_creds.txt | git credential approve"
>
> - name: Fetch Git repository
>   git: dest={{ ansible_env.HOME }}/reponame repo=
http://git.example.com/git/reponame
>
> - name: remove stored creds
>   command: /bin/bash -c "cat git_creds.txt | git credential reject ; rm
git_creds.txt"
>
>
> This has a bad failure mode, though - if the script fails, then the
credentials get left behind on the box.
>
> Is there any better way to do this?!?!
>
> Should I file a bug to have the "git" task take username and password,
and perform the steps that I'm going through above, but then also able to
do the cleanup if the Git command fails? Or should the "git" task be able
to push the password on stdin?

This wouldn't be a bug but it might be a feature.  I'm not sure if we'd
want to do all the credential cache stuff inside of the git module or might
like to split that out into a separate module.

If the password can be given to git on stdin in your case, that does seem
like a way to add it to the current git module.  A pr for that would be
welcome.

-Toshio

-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAG9juErfbyGxtnD%3DGZuJhb19%3DNwPuiqcs464tuJ%2BSNoGkLMcqQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Windows File Difference

2016-02-23 Thread 'J Hawkesworth' via Ansible Project
At the moment I don't think there's anything in the windows modules that 
will help with this.  If anyone knows better please say but I think today 
--check and --diff aren't implemented for windows modules.

However, it might be possible to make use of the --check and --diff 
playbook command line arguments if you first fetch the files that you care 
about back to the controller and then use copy tasks (which won't actually 
copy in --check mode).

There's a thread here describing this

https://groups.google.com/forum/#!topic/ansible-project/6xkSE1nxIOU

That said, as you've pointed out comparing files in powershell is pretty 
straightforward so there's no reason why win_copy couldn't be changed to 
implement --check and --diff modes.

Hope this helps,

Jon

On Tuesday, 23 February 2016 11:29:48 UTC, Mark Matthews wrote:
>
> Hi
>
> I am trying to find an way Ansible can not only alert me of a change in a 
> file but exactly what was changed in that file.
>
> I am currently using win_stat play bookk to check the host file of a 
> server and let me know if anything has changed. This works great, cut it 
> only tells me if something has changed, it doesn;t tell me what has changed 
> in the file.
>
> ---
> - name: Check Host file
>   hosts: all
>   tasks:
>  - name: stat the hosts file
>win_stat:
>  path: C:\windows\system32\drivers\etc\hosts
>register: hosts_fileinfo
>  - name: show hosts file stats for debugging purposes
>debug:
>  var: hosts_fileinfo
>  - name: Fail if Host File Missing
>fail:
>  msg: "WEB.CONFIG file is missing"
>when: hosts_fileinfo.stat.exists != true
>  - name: Fail if Host File Modified
>fail:
>  msg: "HOSTS file has been modified"
>when: hosts_fileinfo.stat.checksum != 
> ""
>
>
> I am looking for something that the following Powershell script does.
> As you can see it has picked up that there is a difference between the two 
> files and it then shows me where the difference is.
>
>
> PS H:\> *Compare-Object -ReferenceObject (Get-Content 
> C:\Temp\applicationHost.config) -DifferenceObject (Get-Content 
>  C:\Temp\applicationHost_2.config)*
>
> InputObject   
>SideIndicator   
> 
> ---   
>-   
> 
>  overrideModeDefault="De... =>   
>
>  overrideModeDefault="D... <=  
>
>
> Any help with this would be really appreciated.
>
> Cheers
> Mark
>
> 
>   
>

-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/8d6ff81c-f115-4e2d-a2e5-5065e3d86810%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Ansible windows modules

2016-02-23 Thread 'J Hawkesworth' via Ansible Project
I would recommend trying the win_package module which can take properties 
and, if you capture the product_id you can use that in your playbook to 
make sure it only attempts installation once.

Hope this helps,

Please report back if this works for you so others can learn from your 
experience.

Many thanks

Jon

On Tuesday, 23 February 2016 04:02:23 UTC, Quang Truong wrote:
>
> Hi all,
>
> I start learning Ansible to run some deployment tasks on Windows platform. 
> I encounter some hiccups with Windows modules as below:
>
> - Install the executable package (.NET 4.5.2 framework)
>
>
>- I download the offline installer (
>https://www.microsoft.com/en-us/download/details.aspx?id=42642) then 
>run the installation with a raw command from my playbook then it return an 
>error ("rc": 16389)
>
> failed: [x.x.x.x] => {"rc": 16389}
> stdout: An error was encountered.
>  
>
> Unspecified error  
>
>
>- I did some searching then this error might relate to the cache size 
>then I use the Web installation (
>https://www.microsoft.com/en-us/download/details.aspx?id=42643) then 
>Ansible can run the package and download the package in middle then throw 
>an error ("rc" 5) (something relates to access denied). I try to use with 
>administrator account for the host inventory but no luck with that move
>
>  - Install an MSI with properties
>
>
>- I try to use win_msi module and see the win_msi.ps1 script that 
>execute the installation by "msiexec.exe /i $params.path /qb /l 
>$logfile $extra_args;" so I try to input the properties within the path 
>parameter, for ex: C:\tool.msi property1=A perty2=b. However, seems my 
>syntax is not correct with the parse function then I got this error
>
> This installation package could not be opened. Verify that the package 
> exists and that you can access it, or contact the application vendor to 
> verify that this is a valid Windows Installer package. 
>
>
>- Then I try to run the raw command in playbook: raw: msiexec.exe /i 
>C:\Tool.msi property1=a property2=b /qn . This way can install this msi, 
> in 
>conclusion, we can't not the win_msi module at the moment for installation 
>with properties?
>
>
> Thank you very much for your help
> Quang 
>

-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/29f920ba-f062-48a4-a0b9-c74bdea19d18%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Windows File Difference

2016-02-23 Thread Mark Matthews
Hi

I am trying to find an way Ansible can not only alert me of a change in a 
file but exactly what was changed in that file.

I am currently using win_stat play bookk to check the host file of a server 
and let me know if anything has changed. This works great, cut it only 
tells me if something has changed, it doesn;t tell me what has changed in 
the file.

---
- name: Check Host file
  hosts: all
  tasks:
 - name: stat the hosts file
   win_stat:
 path: C:\windows\system32\drivers\etc\hosts
   register: hosts_fileinfo
 - name: show hosts file stats for debugging purposes
   debug:
 var: hosts_fileinfo
 - name: Fail if Host File Missing
   fail:
 msg: "WEB.CONFIG file is missing"
   when: hosts_fileinfo.stat.exists != true
 - name: Fail if Host File Modified
   fail:
 msg: "HOSTS file has been modified"
   when: hosts_fileinfo.stat.checksum != 
""


I am looking for something that the following Powershell script does.
As you can see it has picked up that there is a difference between the two 
files and it then shows me where the difference is.


PS H:\> *Compare-Object -ReferenceObject (Get-Content 
C:\Temp\applicationHost.config) -DifferenceObject (Get-Content 
 C:\Temp\applicationHost_2.config)*

InputObject 
 SideIndicator 
  
--- 
 - 
  
https://groups.google.com/d/msgid/ansible-project/39e6fded-4660-40a5-b090-737ce9c7eb2d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: ERROR! 'item' is undefined" with synchronize module + with items

2016-02-23 Thread AS
Struggled with this problem for few days and finally managed to fix it.

1. Removed ansible from the machine (deleted everything)

ansible --version
ansible 2.0.1.0 (detached HEAD bec698052f) last updated 2016/02/22 11:04:54 
(GMT +100)
  lib/ansible/modules/core: (detached HEAD 9552a22b83) last updated 2016/02/
22 11:04:59 (GMT +100)
  lib/ansible/modules/extras: (detached HEAD 51cddf2b35) last updated 2016/
02/22 11:05:05 (GMT +100)
  config file = 
  configured module search path = Default w/o overrides

2. Executed following code:

 - name: Synchronize files
   delegate_to: "{{ inventory_hostname }}"
   synchronize:
 recursive: yes
 links: yes
 times: yes
 src: "{{ item.source }}"
 dest: "{{ item.dest }}"
   with_items: 
- { source: '{{ some_path }}/some.git/file.txt', dest: 
'/abc/def/file.txt' } 

--> works ok

I have had multiple syntax errors in my "code" but by some reason had more 
problems with 2.0.0.2 and 22th Feb 2016 git version seems to work better 
for me.

Found out that one error that I had was one space character indentation 
before the block and previous block was without the indentation so that 
caused one error. However; there were multiple other small syntax errors.

On Friday, 19 February 2016 10:49:34 UTC+2, AS wrote:
>
> Do you guys know why ansible gives me an error 'item' is undefined on this 
> specific case?
>
> Version:
> Ansible 2.0.0.2
> Ubuntu 15.10
>
> - name: Synchronize files 
>   synchronize:
> src: "{{ item.source }}"
> dest: "{{ item.dest }}"
> recursive: yes
> links: yes
> times: yes
> rsync_opts: "--devices"
> with_items:
>   - { source: project/conf/file.conf, dest: /etc/asdf/nginx.conf }
>   - { source: project/conf/somefolder/, dest: /etc/asdf/somefolder/ }
>   - { source: /conf/asdf/anotherfolder/, dest: 
> /etc/asfd/anotherfolder/ }
>
> Result:
> TASK [mumbojumbo: Synchronize files] 
> ***
> task path: /home/asdf/wef/main.yml:27
> fatal: [xxx.xxx.xxx.xxx]: FAILED! => {"failed": true, "msg": "ERROR! 
> 'item' is undefined"}
>
> *Second problem with the same case:*
>
> By some reason using quotes causes an Syntax error?
>
> - name: Synchronize files 
>   synchronize:
> src: "{{ item.source }}"
> dest: "{{ item.dest }}"
> recursive: yes
> links: yes
> times: yes
> rsync_opts: "--devices"
> with_items:
>   - { source: 'project/conf/file.conf', dest: '/etc/asdf/nginx.conf' }
>   - { source: 'project/conf/somefolder/', dest: 
> '/etc/asdf/somefolder/' }
>   - { source: '/conf/asdf/anotherfolder/', dest: 
> '/etc/asfd/anotherfolder/' }
>
> -->
>
> ERROR! Syntax Error while loading YAML.
>
>
> The error appears to have been in 
> '/home/osboxes/analytics/tstdeployment/roles/orfer/tasks/main.yml': line 
> 36, column 86, but may
> be elsewhere in the file depending on the exact syntax problem.
>
> The offending line appears to be:
>
> with_items:
>   - { source: 'project/conf/file.conf', dest: '/etc/asdf/nginx.conf' }
> ^ 
> here
> This one looks easy to fix.  It seems that there is a value started
> with a quote, and the YAML parser is expecting to see the line ended
> with the same kind of quote.  For instance:
>
> when: "ok" in result.stdout
>
> Could be written as:
>
>when: '"ok" in result.stdout'
>
> Or equivalently:
>
>when: "'ok' in result.stdout"
>
>
>

-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/f40edb8f-7d0d-41c1-b9e3-875141957cb9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: win_package product_id

2016-02-23 Thread Trond Hindenes
Is this a package which is publicly available? I'd like to have a closer 
look.

On Friday, February 19, 2016 at 10:10:05 AM UTC+1, Gerald Spencer wrote:
>
> Interesting. So following your advice, the value in 
> HKLM:\Software\microsoft\windows\currentversion\uninstall is Python 3.5*.1 
> (Anaconda3 2.5.0 64-bit)  *and lets say we run:
>
> - name: install conda
>   win_package:
> path: '.\\Desktop\\CondaInstall.exe'
> product_id: 'Python 3.5.1 (Anaconda3 2.5.0 64-bit)'
> arguments: "/S /D=..\\Anaconda3"
>
> When the package is already installed, the task executes as expected and 
> reports no change in state.
> When the package is *not* installed, one would expect for the package to 
> be installed. Instead, the module fails and reports the 
> $LocalizedData.PostValidationError 
>
>- Package from {0} was installed, but the specified ProductId and/or 
>Name does not match package details
>
> It seems to be failing somewhere around Line 925 
> in
>  
> win_package with the Get-ProductEntry in the Set-TargetResource function. 
> The odd thing is, when I pull out Validate-StandardArguments and 
> Get-ProductEntry functions, they act as expected. i.e.
>
>- Validate-StandardArguments ensures that the path exists, reports 
>that the product_id is not a guid 
>
> 
>  
>and sets the $identifyingNumber to the product_id.
>- Get-ProductEntry then takes the parsed $identifyingNumber form 
>Validate-StandardArguments and returns the $keyLocation for the product_id 
>(either 32bit or 64bit uninstall registry keys)
>- Set-TargetResource then tests the resource, notices that the installer 
>is an exe 
>
> 
>  
>and starts the process as requested by the supplied arguments. After 
>install the function should then check if the $Ensure state is set to 
>'Present' (default condition), then it checks to see if the value returned 
>from Get-ProductEntry exists (program was installed.
>
> Unfortunately, it fails to install the exe. I did notice that the process 
> briefly appears in the task manager, then immediately following the failure 
> notice from ansible, drops away. Perhaps the process fails 
> 
>  
> to correctly start with the correct arguments?
>

-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/6c00962c-2e84-41b4-a64f-69e72bbdb919%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Ansible managing Windows hosts with non admin user

2016-02-23 Thread Trond Hindenes
Interesting. My guess would be that this works, as Ansible doesn't do 
anything outside the logged-on user's profile (until you start pushing 
tasks that require admin access, of course). What is the exact error you're 
getting? Can you use the "raw" module to do something simple like list the 
contents of your profile or something? I'd really like to see the full 
verbose log from your console aswell.

On Saturday, February 20, 2016 at 5:35:17 PM UTC+1, Julian Saunders wrote:
>
> Hello,
>
> I use Ansible to manage Linux hosts and just recently had a requirement to 
> manage Windows Servers.
>
> I have Ansible working against a Windows 2012 R2 host using an account 
> (test_user) that is part of the "administrators" group.
>
> I would like reduce the rights of test_user, so it is no longer in the 
> "administrators" group, but can still connect and copy files to its own 
> homedrive, and basically run commands that a user that is part of the 
> "Users" group can.
>
> On removing the user Ansible provives the following error:
>
> fatal: [servername] => 401 Unauthorized. basic auth failed
>
>
> I did a bit of research and found the user needed to be part of the 
> "Remote Management Users", this would allow test_user to run Powershell 
> remotely.  I tested this from another Windows host, and yes it works.
>  
>
> PS> $options=New-PSSessionOption -SkipCACheck -SkipCNCheck
> PS> Enter-PSSession -ComputerName servername -Credential 
> servername\test_user -UseSSL -SessionOption $options
>
>
> However via Ansible I get the following error:
>
> fatal: [servername] => failed to exec cmd PowerShell -NoProfile 
> -NonInteractive -EncodedCommand...
>
>
> Does anyone know if it's possible to run Ansible against a Windows hosts 
> with a non admin user?
>
> Thanks.
>
>

-- 
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 to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/8001f5be-de14-47f7-b688-cb46ab77e96e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.