[ansible-project] How to have windows configured with ansible automatically

2016-03-31 Thread Deepa Yr
Hi My requirement is Provision a windows machine and run the playbooks without manual intervention. In this case, we cannot run the playbooks as windows is not configured for ansible. ie ConfigureRemotingForAnsible.ps1 is not executed on windows machine. Is there a way to

Re: [ansible-project] postgresql_user module failed to authenticate as postgres when set ansible_become

2016-03-31 Thread Cuong Nguyen
Hi Brian, Is there any way to make directives set in task level like mine gets override such directives set in `group_vars` or `host_vars`? On Friday, April 1, 2016 at 4:07:51 AM UTC+7, Brian Coca wrote: > > Expected as this `ansible_become_user: root` overrides your `sudo_user: > postgres` so

[ansible-project] Re: Ansible 2.0 window modules

2016-03-31 Thread Quang Truong
For win_service: put the value in "" then it works :D -- 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] Re: Ansible 2.0 window modules

2016-03-31 Thread Quang Truong
Please disregard about the win_file. I can make it run. My typo error! On Thursday, March 31, 2016 at 6:59:46 PM UTC-7, Quang Truong wrote: > > Hi all, > > I'm using Ansible 2.0 but I have problem with: > - win_file: can't create new directory > > sample playbook > > - name: create Source

Re: [ansible-project] Re: Correct quoting of arguments for raw module

2016-03-31 Thread James Cammarata
That should be fixed in the latest versions of devel/stable-2.0. James Cammarata Ansible Lead/Sr. Principal Software Engineer Ansible by Red Hat twitter: @thejimic, github: jimi-c On Thu, Mar 31, 2016 at 4:07 AM, Johannes Kastl wrote: > On 31.03.16 at 01:04 Uditha Desilva

Re: [ansible-project] Error in yum module

2016-03-31 Thread James Cammarata
If you run it without check mode enabled, does it install the package? James Cammarata Ansible Lead/Sr. Principal Software Engineer Ansible by Red Hat twitter: @thejimic, github: jimi-c On Thu, Mar 31, 2016 at 6:14 AM, Mario Polario wrote: > Hi! > > I installed

[ansible-project] Ansible 2.0 window modules

2016-03-31 Thread Quang Truong
Hi all, I'm using Ansible 2.0 but I have problem with: - win_file: can't create new directory sample playbook - name: create Source directory win_file: path=C:\MySource state=directory - win_service: can't manage windows service (no affect). The input name is the service name (service name

[ansible-project] Re: Ansible winrm problem

2016-03-31 Thread Quang Truong
Have you try to run the EnableAnsible.ps1 before? I encountered this error usually because the preparation for WinRM wasn't run successfully Quang -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop

[ansible-project] Re: Ansible winrm problem

2016-03-31 Thread David O'Brien
Yeah, I saw that one and I'm already setting all the no_proxy environment variables on my Ansible machine. The odd thing is, I can telnet just fine, just can't connect. I tried the pywinrm module directly and get the same error. Printing out the python os.environ.keys I can see all my proxy

[ansible-project] Re: HowTo: combine two lists in vars section/file

2016-03-31 Thread John Buxton
In your second example, you could do this: path: "{{ ['righthere'] | union(level1keyB) }}" I'm not sure it's possible in your first example, because to put this in your "WHAT TO WRITE HERE" section you have to access "addonpath" from another part of the same level1keyA data structure, so you

[ansible-project] Re: Ansible docker module: expose multiple :: combos at once

2016-03-31 Thread Walter Dolce
I found a solution for now. I quickly wrote a filter plugin to obtain what I wanted - https://gist.github.com/walterdolce/93a89018d69392de7c94bf690b761455 The final product for now is: tasks: - name: Install Nginx container docker: name: webserver_nginx image: nginx

Re: [ansible-project] use environment variables of the remote host

2016-03-31 Thread Brian Coca
after fact gathering, the ansible_env variable is populated with the target host's environment vars. ​So ansible_env['PATH'] should have the path variable of the 'inventory_hostname' for the user that gathered facts.​ -- Brian Coca -- You received this message because you are

Re: [ansible-project] postgresql_user module failed to authenticate as postgres when set ansible_become

2016-03-31 Thread Brian Coca
Expected as this `ansible_become_user: root` overrides your `sudo_user: postgres` so you are running it as root. -- 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

Re: [ansible-project] Re: ansible 2.0.1 environement variables of remote host

2016-03-31 Thread Brian Coca
no, just on the hosts you want to use facts from. ​that was an example that would show you the facts per host, 'all' is the only group i know you have for sure.​ -- Brian Coca -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To

[ansible-project] Ansible docker module: expose multiple :: combos at once

2016-03-31 Thread Walter Dolce
Hello Ansiblers! I was trying to think of a way to expose multiple ports in a row by using the docker module (http://docs.ansible.com/ansible/docker_module.html) but I can't think of anything except looping through the values I would need by means of the usual with_items way, which is not what

[ansible-project] ansible hosts and hosts_vars usage

2016-03-31 Thread thanstra
Can someone give me a more complete example of how to tie together ansible hosts file and the hosts_var directory? My ansible hosts file is getting out of hand and I want to break it up better. I use variables for various pieces of info. Currently my hosts file has sections like this:

[ansible-project] Error in yum module

2016-03-31 Thread Mario Polario
Hi! I installed ansible-1.9.4-1.el7.noarch from EPEL repository on RHEL 7.2. I have several test servers to manage. I tried simple playbook: * hosts: webservers remote_user: root tasks: - name: install vim yum: name=vim state=latest* Trying to execute gives me error: #

[ansible-project] Re: ansible 2.0.1 environement variables of remote host

2016-03-31 Thread mondher khas
so , i must gather facts off all hosts , that's the solution ? -- 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.

[ansible-project] Re: Ansible Vault

2016-03-31 Thread Mike Biancaniello
Every item in group_vars/ is named to match a group name. These items can be either files (my_group, my_group.yml) or directories (my_group/). If it is a directory, then it works similarly to a .d/ directory where all of the files in that dir are imported. These are equivilent structures: 1.

Re: [ansible-project] ansible 2.0.1 environement variables of remote host

2016-03-31 Thread Brian Coca
ansible_env reflects the facts on the machine you gathered facts on, so if it is showing localhost values, you ONLY gathered facts on localhost. this should show the path for EACH machine: hosts: all tasks: - debug: msg="{{ansible_env.PATH}}" -- Brian Coca -- You received this

Re: [ansible-project] Re: Ansible Vault

2016-03-31 Thread Arbab Nazar
Mark, just give a try with the /etc/ansible/group_vars/all and don't for to add the --ask-vault-pass to your playbook On Thu, Mar 31, 2016 at 4:18 PM, Mark Matthews wrote: > Hi guys > > Thank you so much for all your feedback. Getting a little confused as to > what to do

[ansible-project] Re: Ansible Vault

2016-03-31 Thread Mark Matthews
Hi guys Thank you so much for all your feedback. Getting a little confused as to what to do now though. Do I create the following folder /etc/ansible/group_vars/all and just copy all the files into that folder? Will that solve the problem? Jon - Im not exactly sure what you mean by, "into a

[ansible-project] ansible 2.0.1 environement variables of remote host

2016-03-31 Thread mondher khas
environment variables - Hello , i use ansible to run tasks in remote machine , i want to work with variables from this remote machine . i tried to use lookup module but it return the variables of my machine to the remote one . i have no idea haw to do it . - i itried to

Re: [ansible-project] How can you set multiple hosts on the same machine with dynamic inventories

2016-03-31 Thread ryangrannell
Sorry, thanks for catching that error. I attached an amended version: { "alias-1": { "vars": { "ansible_host": "example-0.com ", "ansible_port": 5513 }, "hosts": [ "unused-alias-1" ] },

[ansible-project] Re: Ansible winrm problem

2016-03-31 Thread 'J Hawkesworth' via Ansible Project
Guessing here, since this is not something I've tried This poster seemed to get the same error as you: In his case there was a proxy involved. Would there be a proxy in your scenario too? I think there are winrm proxy settings now although this isn't something I've tried.

[ansible-project] Re: Ansible Vault

2016-03-31 Thread 'J Hawkesworth' via Ansible Project
Hi Mark, Bit late to this one but as well as using group_vars folders I'd suggest organizing things so that you aren't trying to do this: ansible_ssh_pass: {{ winservers_password }} so you can avoid a vault lookup of a var. Instead I'd put the ansible_ssh_pass: ACTUAL_SECRET_PASSWORD into

Re: [ansible-project] Re: Ansible Vault

2016-03-31 Thread Johannes Kastl
Am 31.03.16 schrieb Brian Coca: > You can have multiple files on a group named dir. Of course, but I thought the files the OP mentioned were for different groups... Johannes -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe

[ansible-project] postgresql_user module failed to authenticate as postgres when set ansible_become

2016-03-31 Thread Cuong Nguyen
Hi guys, I have a task to create postgresql user as follow: - name: Create database user postgresql_user: > name="{{ db_user }}" password="{{ db_pass }}" encrypted=yes role_attr_flags="NOSUPERUSER,NOCREATEDB,NOCREATEROLE,INHERIT,LOGIN" sudo_user: postgres

[ansible-project] Can Ansible reference pre-existing CloudFormation stacks?

2016-03-31 Thread vjorgensen
Hi! I have an ansible playbook that looks something like the one below (edited for brevity). I have another CloudFormation stack created by another process outside my control that creates many common references. Is there a way to make "common_stack" a variable such that "{{

[ansible-project] Ansible winrm problem

2016-03-31 Thread David O'Brien
Hi guys, I'm spinning up EC2 instances on AWS and I'm getting the following error: TASK [setup] *** <10.178.73.194> ESTABLISH WINRM CONNECTION FOR USER: Administrator on PORT 5986 TO 10.178.73.194 fatal: