[ansible-project] changing hostname/ipadress

2016-02-29 Thread Daan Hoogland
LS,

When a play I write changes the adres or name by which a host is adressed 
(i.e. ansible_host value) is it possible to tell ansible to use a new value 
for this target from there on? I am trying to recreate an instance in a 
cloud. after the recreation some simple lineinfile, user, authorized_key 
and package tasks need to be performed.

regards,
Daan

-- 
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/9729ddab-1710-4496-9f0b-fd45935d3a46%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Ansible API : Expand variables

2016-02-29 Thread amit bhagat
Actually, the dictionary looks like this-

d2 = {'4.4.4.4':'10.0.0.0/8,11.0.0.0/8', '5.5.5.5':'10.0.0.0/8'}

On Monday, February 29, 2016 at 8:05:23 AM UTC-8, amit bhagat wrote:
>
> I have written a custom module "filter_prefix" that accepts "host" and 
> "prefixes".
>
> I have a dictionary that looks like this - 
> d2 = {'4.4.4.4':'10.0.0.0/8','11.0.0.0/8', '5.5.5.5':'10.0.0.0/8'}
>
> In the API script, I have -
>
> hosts = d2.keys()
> device_inventory = Inventory(hosts)
>
> pb = Runner(
> module_name = 'filter_prefix',
> module_args = 'host={{ inventory_hostname }} prefixes= ???',
> transport = local,
> inventory = device_inventory)
>
> I would like to be able to pass appropriate 'value'  to prefixes based on 
> 'host' from d2 dictionary. I tried using -
> prefixes="d2[ '{{ inventory_hostname }}' ]" but then it doesn't expand d2.
>
> I am running ansible version 1.9.2.
>
> Any ideas?
>
> Amit
>

-- 
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/47a48fde-07da-4d2d-be46-e6f88ae04750%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Copy to local

2016-02-29 Thread larry . singer
I am trying to write a file to my local machine with a dynamic inventory. I 
am running the following script in Ansible Tower:
---
- hosts: all
  tasks:
  - name: Copy the file
connection: local
run_once: true
copy: content="Hello, World!" dest=/tmp/hello.txt

This works when I run it without the connection: local (it ends up on the 
first matching host), but with connection: local the file does not appear, 
even though Ansible Tower shows that there was something changed. I have 
tried delegate_to: 127.0.0.1 and local_action: and in none of these cases 
do I find the file in /tmp.

Am I doing something wrong or is this a problem with Ansible?

Ansible version 2.0.1.0, Ansible Tower version 2.4.4.

-- 
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/b09b7eac-a5dc-47e9-ab0e-53b60c54a6ec%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Group variables conditional based on OS distribution release

2016-02-29 Thread Brian Coca
yes, you need to gather facts before that variable is available, you might
want to use |default filter to avoid the error


-- 
--
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/CACVha7fjAc2Ot3Cv6sHwRaFvCiZ1_8U-dq1qm4iqUnBGp04%3DAw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Use requirements.yml in a lookup?

2016-02-29 Thread Brian Coca
​vars_files or include_vars will read  a yaml file into a data structure
you can then use in template module​

On Mon, Feb 29, 2016 at 2:34 AM, Johan  wrote:

> Hello!
>
> I would like to take my requirements.yml and make a config for
> https://github.com/beefsack/git-mirror
>
> Any idea for how to accomplish this? I thought about using a lookup
> somehow, but with requirements.yml already being YAML maybe there is a
> better way?
>
> Basically I'd like to take each "src: https://github../role-1; in
> requirements.yml and turn into a file that looks like:
>
> 
> ListenAddr = ":8080"
> BasePath = "/var/mirror"
> Interval = "15m"
>
> [repo]
> Origin = "https://github../role-1;
>
> [repo]
> Origin = "https://github../role-2;
> 
>
> // Johan
>
> --
> 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/14dcd4d9-55be-4feb-9df3-7b2b0ae4d6c9%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/CACVha7cQRgDJye30L5vSFGE2Bf-f1_7rDpWHBPT2NP%2Bm3i0DFA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: win_template always changing?

2016-02-29 Thread Brian Coca
the way checksums are calculated on the unix side had changes and they seem
to have affected the windows side also, mdavis recently made an update to
compensate for that, please check against current devel to see if the
problem persists.

On Mon, Feb 29, 2016 at 12:05 PM, 'J Hawkesworth' via Ansible Project <
ansible-project@googlegroups.com> wrote:

> Hi I have noticed this behaviour when running the windows integration
> tests.  As far as I can tell it is something that has started happening
> relatively recently.
> What version of ansible are you using?
>
> Many thanks,
>
> Jon
>
>
> On Monday, 29 February 2016 11:39:43 UTC, Chris Bennett wrote:
>>
>> Hi there,
>>
>> I've just starting hitting some Windows hosts with Ansible & winrm and
>> when I use the win_template module, it changes every run:
>>
>> conf:
>> ==
>>   - name: Install nxlog.conf template
>> win_template:
>> src=templates/nxlog/nxlog.conf.tmpl
>> dest="c:\\Program Files (x86)\\nxlog\\conf\\nxlog.conf"
>> tags:
>>   - conf
>> notify:
>>   - restart nxlog
>>
>> First run:
>> ==
>>   $ date;  time ansible-playbook  -i inv -l svrexch13-01.victor.sa.gov.au
>> win-syslog.yml  --tags conf
>>   Mon Feb 29 22:06:54 ACDT 2016
>>
>>   PLAY [win]
>> *
>>
>>   TASK [Install nxlog.conf template]
>> *
>>   changed: [svrexch13-01.victor.sa.gov.au]
>>
>>   PLAY RECAP
>> *
>>   svrexch13-01.victor.sa.gov.au : ok=1changed=1unreachable=0
>>  failed=0
>>
>>
>>   real0m16.140s
>>   user0m1.207s
>>   sys 0m0.203s
>>
>> (confirmed config is correct on remote host)
>>
>>
>> Second run:
>> ==
>>   $ date;  time ansible-playbook  -i inv -l svrexch13-01.victor.sa.gov.au
>> win-syslog.yml  --tags conf
>>   Mon Feb 29 22:07:19 ACDT 2016
>>
>>   PLAY [win]
>> *
>>
>>   TASK [Install nxlog.conf template]
>> *
>>   changed: [svrexch13-01.victor.sa.gov.au]
>>
>>   PLAY RECAP
>> *
>>   svrexch13-01.victor.sa.gov.au : ok=1changed=1unreachable=0
>>  failed=0
>>
>>
>>   real0m16.150s
>>   user0m1.206s
>>   sys 0m0.192s
>>
>>
>> Has anyone else observed the same thing?
>>
>> Thanks,
>>
>> Chris
>>
> --
> 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/ac827bf5-e50f-4947-b0e2-0e88f8c80863%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/CACVha7cNgQnJPNBw5q36YC525hbn7fzn578r3CCWyKFOCH7KTA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Trying to dynamically load var files

2016-02-29 Thread Brian Coca
first, don't put anything under group_vars/host_vars that you want to
selectively load, these files will load automatically if matched. Using
include_vars against group/host_vars is not recommended.

2nd the easiest way is putting them in a vars/ folder adjacent to play (or
in role) and use include_vars:

- include_vars: "{{item}}.yml"
  with_items: "{{apps}}"

if what you want it to load both files with last one overriding previous
ones when the same vars are in multiple files.

On Mon, Feb 29, 2016 at 6:47 PM, Chris 
wrote:

> I'm not seeing a clear way on how to do this in the docs, and maybe there
> is some other way to go about it. Basically I want to load up data about
> multiple applications to use in a template. I tried using include_vars, but
> I'm not seeing how to dynamically load that. I currently have this
> structure:
>
> groups_vars/staging_apps.yml:
> ---
> apps: ['app1','app2']
>
> I want to then load these files by using the app names from above:
> groups_vars/apps/app1.yml
> groups_vars/apps/app2.yml
>
> Those files would have additional variables that define each app.
>
> In the task I was thinking something along the lines of:
>
> ---
>   - include_vars: group_vars/staging.yml
>
>   - name: Print apps
> debug: msg="App {{ apps }}"
>
>   - include_vars:
> .. etc
>
> Any help 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/e1eb9e2b-82ba-4bf3-8f1a-a3a235fe371e%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/CACVha7fZx25wjHvE7q9AxHJDmaTVLe4gx3ohYissr8Fca5UQjw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Trying to dynamically load var files

2016-02-29 Thread Chris
I'm not seeing a clear way on how to do this in the docs, and maybe there 
is some other way to go about it. Basically I want to load up data about 
multiple applications to use in a template. I tried using include_vars, but 
I'm not seeing how to dynamically load that. I currently have this 
structure:

groups_vars/staging_apps.yml:
---
apps: ['app1','app2']

I want to then load these files by using the app names from above:
groups_vars/apps/app1.yml
groups_vars/apps/app2.yml

Those files would have additional variables that define each app.

In the task I was thinking something along the lines of:

---
  - include_vars: group_vars/staging.yml

  - name: Print apps
debug: msg="App {{ apps }}"

  - include_vars:
.. etc

Any help 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/e1eb9e2b-82ba-4bf3-8f1a-a3a235fe371e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] How do I pass a password as an argument?

2016-02-29 Thread Gilberto Valentin
I have a playbook that installs the appropriate packages for Active 
Directory Authentication. When it gets to the "join" portion, Ansible just 
sits there because the join process is asking the user for the password of 
the account that has access to join the system to Active Directory. How can 
I pass my password from vars_prompt? I have highlighted where I call the 
variable but I know that is the wrong place since it's going to try to pass 
it to my "realm join" command, which isn't supported. I only added it there 
to show I want to call it after the "realm join" portion is called.

Here is my playbook:

---
## This playbook installs and configures AD authentication

- name: Install and configure AD authentication
  hosts: linux
  remote_user: root

  vars_prompt:
- name: "ad_password"
  prompt: "Enter AD Domain User Password"
  private: yes

  tasks:
- name: install ad_auth required tools
  yum: pkg={{ item }} state=installed
  with_items:
- realmd
- sssd
- oddjob-mkhomedir
- adcli
- samba-common-tools

- name: discover and join domain
  shell: realm discover AD.DOMAIN.TLD && realm join AD.DOMAIN.TLD
--computer-ou=OU=LINUX,DC=DOMAIN,DC=TLD --user=user_name {{ 
ad_password }}

- name: modify /etc/sssd/sssd.conf
  template: 
src=/home/user_name/git/system_configs/ansible/templates/sssd.j2 
dest=/etc/sssd/sssd.conf
  notify:
- restart sssd

  handlers:
- name: restart sssd
  service: name=sssd state=restarted

This is the error I get after running it:

[user_name@server_name playbooks]$ ansible-playbook adAuth_asRoot.yaml 
--user=root --ask-pass
SSH password:
Enter AD Domain User Password:

PLAY [Install and configure AD authentication] 


GATHERING FACTS 
***
ok: [ansible]

TASK: [install ad_auth required tools] 

ok: [ansible] => 
(item=realmd,sssd,oddjob-mkhomedir,adcli,samba-common-tools)

TASK: [discover and join domain] 
**
failed: [ansible] => {"changed": true, "cmd": "realm discover AD.DOMAIN.TLD 
&& realm join AD.DOMAIN.TLD --computer-ou=OU=LINUX,DC=DOMAIN,DC=TLD 
--user=user_name ad_password", "delta": "0:00:00.053695", "end": 
"2016-02-29 20:39:40.764101", "rc": 2, "start": "2016-02-29 
20:39:40.710406", "warnings": []}
stderr: realm: Specify one realm to join
stdout: domain.tld
  type: kerberos
  realm-name: DOMAIN.TLD
  domain-name: domain.tld
  configured: no
  server-software: active-directory
  client-software: sssd
  required-package: oddjob
  required-package: oddjob-mkhomedir
  required-package: sssd
  required-package: adcli
  required-package: samba-common

FATAL: all hosts have already failed -- aborting

PLAY RECAP 

   to retry, use: --limit @/home/user_name/adAuth_asRoot.yaml.retry

ansible: ok=2changed=0unreachable=0failed=1

Is there a better way to provide passwords when certain tasks call for it?

-- 
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/2d0dbdd9-5b48-4fb7-9412-c7285b0e3591%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] How to pass a password as an argument?

2016-02-29 Thread Gilberto Valentin
I have a playbook that installs the appropriate packages for Active 
Directory Authentication. When it gets to the "join" portion, Ansible just 
sits there because the join process is asking the user for the password of 
the account that has access to join the system to Active Directory. How can 
I pass my password from vars_prompt? I have highlighted where I call the 
variable but I know that is the wrong place since it's going to try to pass 
it to my "realm join" command, which isn't supported. I only added it there 
to show I want to call it after the "realm join" portion is called.

Here is my playbook:

---
## This playbook installs and configures AD authentication

- name: Install and configure AD authentication
  hosts: linux
  remote_user: root

  vars_prompt:
- name: "ad_password"
  prompt: "Enter AD Domain User Password"
  private: yes

  tasks:
- name: install ad_auth required tools
  yum: pkg={{ item }} state=installed
  with_items:
- realmd
- sssd
- oddjob-mkhomedir
- adcli
- samba-common-tools

- name: discover and join domain
  shell: realm discover AD.DOMAIN.TLD && realm join AD.DOMAIN.TLD
--computer-ou=OU=LINUX,DC=DOMAIN,DC=TLD --user=user_name {{ 
ad_password }}

- name: modify /etc/sssd/sssd.conf
  template: 
src=/home/user_name/git/system_configs/ansible/templates/sssd.j2 
dest=/etc/sssd/sssd.conf
  notify:
- restart sssd

  handlers:
- name: restart sssd
  service: name=sssd state=restarted

This is the error I get after running it:

[user_name@server_name playbooks]$ ansible-playbook adAuth_asRoot.yaml 
--user=root --ask-pass
SSH password:
Enter AD Domain User Password:

PLAY [Install and configure AD authentication] 


GATHERING FACTS 
***
ok: [ansible]

TASK: [install ad_auth required tools] 

ok: [ansible] => 
(item=realmd,sssd,oddjob-mkhomedir,adcli,samba-common-tools)

TASK: [discover and join domain] 
**
failed: [ansible] => {"changed": true, "cmd": "realm discover AD.DOMAIN.TLD 
&& realm join AD.DOMAIN.TLD --computer-ou=OU=LINUX,DC=DOMAIN,DC=TLD 
--user=user_name ad_password", "delta": "0:00:00.053695", "end": 
"2016-02-29 20:39:40.764101", "rc": 2, "start": "2016-02-29 
20:39:40.710406", "warnings": []}
stderr: realm: Specify one realm to join
stdout: domain.tld
  type: kerberos
  realm-name: DOMAIN.TLD
  domain-name: domain.tld
  configured: no
  server-software: active-directory
  client-software: sssd
  required-package: oddjob
  required-package: oddjob-mkhomedir
  required-package: sssd
  required-package: adcli
  required-package: samba-common

FATAL: all hosts have already failed -- aborting

PLAY RECAP 

   to retry, use: --limit @/home/user_name/adAuth_asRoot.yaml.retry

ansible: ok=2changed=0unreachable=0failed=1

Is there a better way to provide passwords when certain tasks call for it?

-- 
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/974724af-6cc1-4115-8d67-1b4fb0a891c9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] ansible_env is undefined

2016-02-29 Thread Brian Coca
As per https://github.com/ansible/ansible/blob/devel/CHANGELOG.md

"Fix to make implicit fact gathering task correctly inherit settings from
play, this might cause an error if settings environment on play depending
on 'ansible_env' which was previously ignored"

On Mon, Feb 29, 2016 at 7:44 PM, Ben Cohen  wrote:

> After upgrading ansible versions:
>
> ncohen@breathe ~/s/f/fn-ansible (master)> ansible --version
>
> ansible 2.0.1.0
>
>   config file = /Users/ncohen/software/face/fn-ansible/ansible.cfg
>
>   configured module search path = Default w/o overrides
>
> I'm getting an error on first usage of ansible_env variable
>
> ```
> - hosts: local
>   environment:
> PATH: "{{ ansible_env.PATH }}:/usr/local/bin"
>   tasks:
>   ...
> ```
>
>
> Error looks like this:
>
> ```
> PLAY
> ***
>
>
> TASK [setup]
> ***
>
> fatal: [localhost]: FAILED! => {"failed": true, "msg": "'ansible_env' is
> undefined"}
>
>
> NO MORE HOSTS LEFT
> *
>
> to retry, use: --limit @
>
> PLAY RECAP
> *
>
> localhost  : ok=0changed=0unreachable=0
> failed=1
> ```
>
> Anyone have any idea what's going on?  This worked on 2.0.0.1 without
> issue ...
>
>
> --
> 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/CABUBibsio9cKH7r8-CR%2Bd8xCJSe0SBC1jFGP2F3L%2B%3DLXCba5dw%40mail.gmail.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/CACVha7f61cUZwLjm-%3DBEPmJB-EPDJK5x%3DPBf4Y3%2B%2BNJTcuqUfQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Ansible windows modules

2016-02-29 Thread Quang Truong
Actually, when I update with all the latest updates from Windows, I can go 
through the problem, means, with the latest Windows update, you're good 
with msu installation.

Thank you all!

-- 
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/35814d06-7d57-4b1d-8d99-9207e356d553%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] ansible_env is undefined

2016-02-29 Thread Ben Cohen
After upgrading ansible versions:

ncohen@breathe ~/s/f/fn-ansible (master)> ansible --version

ansible 2.0.1.0

  config file = /Users/ncohen/software/face/fn-ansible/ansible.cfg

  configured module search path = Default w/o overrides

I'm getting an error on first usage of ansible_env variable

```
- hosts: local
  environment:
PATH: "{{ ansible_env.PATH }}:/usr/local/bin"
  tasks:
  ...
```


Error looks like this:

```
PLAY
***


TASK [setup]
***

fatal: [localhost]: FAILED! => {"failed": true, "msg": "'ansible_env' is
undefined"}


NO MORE HOSTS LEFT
*

to retry, use: --limit @

PLAY RECAP
*

localhost  : ok=0changed=0unreachable=0failed=1

```

Anyone have any idea what's going on?  This worked on 2.0.0.1 without issue
...

-- 
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/CABUBibsio9cKH7r8-CR%2Bd8xCJSe0SBC1jFGP2F3L%2B%3DLXCba5dw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Python - ValueError: I/O operation on closed file

2016-02-29 Thread Slim Slam
Ansible 2.0.1 

When I ssh into a Linux server and run:

$ ansible-playbook -vv build.yml

it runs fine. 

But if I ssh into the Linux server and run:

$ nohup ansible-playbook -vv build.yml

or

$ ansible-playbook -vv build.yml > output &

or

$ nohup ansible-playbook -vv build.yml > nohup.out

or

$ nohup ansible-playbook -vv build.yml > nohup.out 2>&1 &


it always fails on this task:

- name: wait for something to happen
  pause: seconds=15

Like this:

TASK [wait for something to happen] 
**
task path: /build.yml:94
Pausing for 15 seconds
(ctrl+C then 'C' = continue early, ctrl+C then 'A' = abort)
An exception occurred during task execution. The full traceback is:
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/ansible/executor/
task_executor.py", line 120, in run
res = self._execute()
  File "/usr/local/lib/python2.7/site-packages/ansible/executor/
task_executor.py", line 418, in _execute
result = self._handler.run(task_vars=variables)
  File "/usr/local/lib/python2.7/site-packages/ansible/plugins/action/pause.
py", line 123, in run
fd = self._connection._new_stdin.fileno()
ValueError: I/O operation on closed file
fatal: [localhost]: FAILED! => {"failed": true, "msg": "Unexpected failure 
during module execution.", "stdout": ""}

I'm pretty sure it has something to do with STDOUT not being available but 
I'm not sure of the workaround. Anyone
have a suggestion?

===

-- 
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/d71a02a8-a2cd-42e1-ac93-696016e3fea9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Docker module giving error after image is pulled

2016-02-29 Thread Guy Knights
I figured it out - I didn't realise, but the installation instructions for 
docker on Ubuntu have changed. I went through the instructions 
at https://docs.docker.com/engine/installation/linux/ubuntulinux/ and the 
issue is now fixed. I guess the older lxc-docker package was configured to 
use the v1 registry endpoint. After installing the new docker-engine 
package my docker tasks are working again.

On Monday, February 29, 2016 at 3:16:21 PM UTC-8, Guy Knights wrote:
>
> For the record, this was working fine a couple of hours ago.
>
> On Monday, February 29, 2016 at 3:13:45 PM UTC-8, Guy Knights wrote:
>>
>> I have a role that runs nginx in a docker container using the official 
>> nginx image from docker hub. The docker task returns the following error 
>> after it pulls the image:
>>
>> "failed": true, "msg": "Unrecognized status from pull.", "status": "
>> docker.io/library/nginx: this image was pulled from a legacy registry. 
>>  Important: This registry version will not be supported in future versions 
>> of docker."
>>
>> I tried completely removing the image and associated containers from the 
>> machines that were running it and then I re-ran the playbook that executes 
>> this task, but it still gives the same error.
>>
>> Does anyone know a way to fix this?
>>
>> Thanks,
>> Guy
>>
>

-- 
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/71ab180e-3407-439e-906a-336dab6285c8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Docker module giving error after image is pulled

2016-02-29 Thread Guy Knights
For the record, this was working fine a couple of hours ago.

On Monday, February 29, 2016 at 3:13:45 PM UTC-8, Guy Knights wrote:
>
> I have a role that runs nginx in a docker container using the official 
> nginx image from docker hub. The docker task returns the following error 
> after it pulls the image:
>
> "failed": true, "msg": "Unrecognized status from pull.", "status": "
> docker.io/library/nginx: this image was pulled from a legacy registry. 
>  Important: This registry version will not be supported in future versions 
> of docker."
>
> I tried completely removing the image and associated containers from the 
> machines that were running it and then I re-ran the playbook that executes 
> this task, but it still gives the same error.
>
> Does anyone know a way to fix this?
>
> Thanks,
> Guy
>

-- 
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/27206035-21cf-4886-b08f-56788f97530c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Docker module giving error after image is pulled

2016-02-29 Thread Guy Knights
I have a role that runs nginx in a docker container using the official 
nginx image from docker hub. The docker task returns the following error 
after it pulls the image:

"failed": true, "msg": "Unrecognized status from pull.", "status": 
"docker.io/library/nginx: this image was pulled from a legacy registry. 
 Important: This registry version will not be supported in future versions 
of docker."

I tried completely removing the image and associated containers from the 
machines that were running it and then I re-ran the playbook that executes 
this task, but it still gives the same error.

Does anyone know a way to fix this?

Thanks,
Guy

-- 
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/715dfb8b-0674-4d48-9935-876727fa8f7e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: selinux-python and ansible 'identification'

2016-02-29 Thread richard kappler
Brilliant, I think that gives me everything I need other than to dive 
deeper into selinux contexts, thanks Brian, 
regards, Richard

On Monday, February 29, 2016 at 4:07:21 PM UTC-5, Brian Coca wrote:
>
> So the current yum module can install from an rpm, even if you cannot use 
> the copy module you should be able to :
>
> - shell: scp ​selinux-python.xxx.rpm {{inventory_hostname}:/path/to/temp:
>   connection: local
>
> - yum: name=/path/to/temp/selinux-python.xxx.rpm
>
> or if you can publish to an internal webserver:
>
> - yum: name=http:/package_source.local/​selinux-python.xxx.rpm
>
>
> As for the modules themselves, yes, they do get copied to the target host 
> in a temp dir in the home of the login user, then they get deleted.
>
> selinux-python does NOT give any new privileges to the user, it is just 
> for managing selinux context of files touched by ansible.
>
>
> --
> 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/0bf0a0e6-6441-4995-b9c5-52395d02fe81%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: selinux-python and ansible 'identification'

2016-02-29 Thread Brian Coca
So the current yum module can install from an rpm, even if you cannot use
the copy module you should be able to :

- shell: scp ​selinux-python.xxx.rpm {{inventory_hostname}:/path/to/temp:
  connection: local

- yum: name=/path/to/temp/selinux-python.xxx.rpm

or if you can publish to an internal webserver:

- yum: name=http:/package_source.local/​selinux-python.xxx.rpm


As for the modules themselves, yes, they do get copied to the target host
in a temp dir in the home of the login user, then they get deleted.

selinux-python does NOT give any new privileges to the user, it is just for
managing selinux context of files touched by ansible.


--
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/CACVha7dOrp4%3DPDYmzzwzeLck-4OX%3DipHc9RuYpEW%3D4bM_e779Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: selinux-python and ansible 'identification'

2016-02-29 Thread richard kappler
Thanks to Brian for the reply, it begs a couple more questions, but first 
let me state my 'new understandings'  based on some sleuthing I did through 
our testenv logs and ansible core modules code while trying to figure this 
out. It looks to me like when you first use ansible a .ansible dir is setup 
in the topmost level dir (~) and within is a tmp directory. I'm surmising 
that ansible writes the modules it needs to that tmp dir, executes the 
modules according to the playbook on the ansible host, then deletes them on 
it's way out the door when the play is finished. Is this correct? It also 
appears from our logs that any scripts (modules) that are executed during 
the play (ex: copy.py) are prepended with ansible- (as in ansible-copy.py) 
hence the target 'knows' its ansible doing whatever it's doing. If this is 
so, then Brian I have to ask because this makes my life so much easier (and 
I know that is what you live for ;-)), does the selinux-python binding 
setup an 'ansible user', or give anything with ansible root privileges or 
somesuch, is that how the selinux context works?

Thanks for all the help, looking forward to your response.

regards, Richard

-- 
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/bc716b5d-7d7f-49fa-b338-a181bd711b5f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] selinux-python and ansible 'identification'

2016-02-29 Thread richard kappler
I see now that I forgot to add the important comment that these machines do 
not have internet access. Hence I would need to copy the selinux-python rpm 
to the target machines, which it would seem that I cannot do until I have 
that rpm installed. Or am I missing something? I could just scp the file to 
the targets, then install it with ansible, that would make things a little 
easier.

On Monday, February 29, 2016 at 3:29:03 PM UTC-5, Brian Coca wrote:
>
> So responding the the main points:
>
> - You should not need to do install selinux-python by hand, you could just 
> use the 'yum' module in a 'boostraping' play (or worst case, 'raw' module).
>
> - The modules shipped with Ansible are all python (version 2), but in 
> general they can be language independent. Even python3 modules should work 
> fine.
>
> - The reason Ansible requires the selinux-python module is that otherwise 
> the template/copy and other file operations will be unable to keep the 
> correct selinux context when they operate on files. We have made sure the 
> standard Ansible modules do this correctly, hence the dependency. Other 
> custom/3rd party modules might not have this dependency, but will probably 
> cause issues by not preserving the selinux context.
>
> --
> 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/9a78c46c-cae1-4b08-8a98-610f1353b399%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] selinux-python and ansible 'identification'

2016-02-29 Thread Brian Coca
So responding the the main points:

- You should not need to do install selinux-python by hand, you could just
use the 'yum' module in a 'boostraping' play (or worst case, 'raw' module).

- The modules shipped with Ansible are all python (version 2), but in
general they can be language independent. Even python3 modules should work
fine.

- The reason Ansible requires the selinux-python module is that otherwise
the template/copy and other file operations will be unable to keep the
correct selinux context when they operate on files. We have made sure the
standard Ansible modules do this correctly, hence the dependency. Other
custom/3rd party modules might not have this dependency, but will probably
cause issues by not preserving the selinux context.

--
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/CACVha7f777F4mc-%2Bpdw58USr9deeTzpF34Uebf4QmjB7z4e%3DTQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Variable Inheritance?

2016-02-29 Thread strowi
Hi everyone,

does someone know if/how it is possible to get variables inherited/extened?

I have a hostgroup develop with a dict applied to all hosts. Now i would 
like to append a single entry to the dict just for one host of the group 
(without specifying the whole dict again of course)..

Eg.:

group_vars/server_develop.yml:
groups:
  web:
gid: 1001
state: present
  dev:
gid: 1003
state: present

host_vars/host1.yml:
groups:
  sys:
gid: 1001
state: present

i would like to be all 3 groups present on host1...

regards,
strowi

-- 
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/ab96af92-34da-4b1f-a1b5-2111d1c783da%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Variable Inheritance?

2016-02-29 Thread strowi
Hi everyone,

i am searching the docs but couldn't find a good reference... 

Is ther a way to inherit/extend variables from group_vars -> host_vars?

E.g.:
group_vars/develop.yml
groups:
  web:
gid: 1002
state: present

host_vars/host1.yml
groups:
  sys:
gid: 1001
state: present

Now i would like to have both groups on host1 and not only group sys...?

regards,
strowi

-- 
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/261dbc15-cdbc-4180-85ff-af1b6e6caa91%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Ansible docker module does not allow me to use bind mode :Z

2016-02-29 Thread Chris Houseknecht
What version of ansible are you running? 

According to the doc strings in the docker.py module:

volumes:

  description:

- List of volumes to mount within the container

- 'Use docker CLI-style syntax: C(/host:/container[:mode])’

- You can specify a read mode for the mount with either C(ro) or C(rw). 
Starting at version 2.1, SELinux hosts can 

  additionally use C(z) or C(Z) mount options to use a shared or 
private label for the volume.


If I'm understanding the above correctly, options z and Z became available 
for SE Linux hosts in Ansible 2.1.

Also, I wonder if the format of ` - /mydata/folder:/opt/mydata/:Z` might be 
incorrect? I would remove the last '/', changing it to ` - 
/mydata/folder:/opt/mydata:Z`



--Chris


On Monday, February 29, 2016 at 6:29:35 AM UTC-5, ishan jain wrote:
>
> When i try to run the following task:
>
> - name: start docker container
>   docker:
> name: container
> image: img
> state: started
>expose:
>   - 8301:8182
>volumes:
>   - /mydata/folder:/opt/mydata/:Z
>
>
> Ansible poses an error - {"changed": false, "failed": true, "msg": "bind 
> mode needs to either be \"ro\" or \"rw\""}
>
> I was facing a lot of issues with volumes earlier when i was using :ro 
> (manual deployment) which went away after simply using :Z. Now ansible is 
> not letting me use it and the same images are posing errors when starting. 
> Can you please tell me why it is not allowed and how to come around this 
> thing ?
>

-- 
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/84df64d3-91da-4062-baae-ad9229dfcd22%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] selinux-python and ansible 'identification'

2016-02-29 Thread richard kappler
We will be making changes to nearly a hundred client machines using 
ansible. We've used ansible before, albeit we're still pretty new at it, 
but have a pretty good handle on it and have done before what we want to do 
now, which is edit a config file. The new target machines have selinux 
enabled and enforcing. As the documentation tells us, we need to deploy 
selinux-python to each of the targets in order to use copy, replace or 
template functions in our playbooks for those machines. This will have to 
be done by hand. We're having a 'devils advocate' scrum before we go to the 
client and tell them what we will be doing, and some questions have come up 
that I do not yet have the knowledge/experience to answer.

The docs tell me ansible works by pushing ansible modules to the target 
machine and executing them over ssh provided your security certs have been 
installed (ours have). I presume that these modules are python scripts. Are 
they specifically identified as ansible scripts to the target? I should 
think not, the target really ought not care as I understand it. But what 
does selinux-python do? Why won't copy, replace or template work without 
it? And does it make a permanent change? Is it ansible specific? 

I expect I'm not asking the questions well, but the client will almost 
certainly ask what the python bindings allow that did not exist before and 
does this create a potential security issue? If we can tell them that it's 
ansible and only ansible specific and explain even superficially how, then 
we might be allowed to use it. If it is not ansible specific and allows 
anybody to come in and execute any python script, then we have a harder 
road ahead of us that may involve scrapping ansible for use with this 
client and going into each machine and hand editing files.

regards, Richard

-- 
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/a7b5c1c1-bc8a-46cb-8c8c-e48be0161c74%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Unable to use "os_keypair" module, while "nova keypair-add" works

2016-02-29 Thread David Shrewsbury
Hi!

You first need to upgrade your version of shade. The latest version is 
1.4.0.

Second, you should not expect a clouds.yaml to be read from the current
directory because of the way Ansible works (copying modules to temp 
directories
on the target host before running them). Instead, place it either in the
/etc/openstack directory, or in ~/.config/openstack (of the user running the
task).

Alternatively, you can just use the normal OS_ environment variables, but 
you
should not mix use of env vars with clouds.yaml.

-David


On Monday, February 29, 2016 at 11:05:21 AM UTC-5, Thiago Martins wrote:
>
> Hey guys!
>
>  Ansible is AWESOME!:-D
>
>  I'm planning to move away from running "shell:" via Ansible, in favor of 
> native modules, but, it is not working, as follows...
>
>  Can someone explain to me, why this task works:
>
> ---
>
> - name: ubuntu | uploading SSH Keypair into OpenStack
>   environment: "{{ demo_openrc_env }}"
>   shell: nova keypair-add --pub-key "/home/{{ubuntu_user}}/.ssh/id_rsa.pub" 
> default
>
> ---
>
>  And why this does NOT work:
>
> ---
>
> - name: ubuntu | uploading SSH Keypair into OpenStack
>   environment: "{{ demo_openrc_env }}"
>   os_keypair:
>   state: present
>   name: default
>   public_key_file: "/home/{{ubuntu_user}}/.ssh/id_rsa.pub"---
>
> ---
> ERROR:
> -
> TASK [os_user_key : ubuntu | uploading SSH Keypair into OpenStack] 
> *
> An exception occurred during task execution. To see the full traceback, use 
> -vvv. The error was: AttributeError: 'OpenStackCloud' object has no attribute 
> 'get_keypair'
> fatal: [localhost]: FAILED! => {"changed": false, "failed": true, "parsed": 
> false}
>
> ---
>
>  What am I missing? Appending "-vvv" doesn't help either...
>
>  I also tried to use the "clouds:" entry of "os_keypair" but, also, 
> doesn't work... It doesn't find "mycloud", even if clouds.yml is there on 
> same dir of task... So, I'll prefer for now, to use "environment:", if 
> possible...
>
>  Any clues?
>
>  Thanks in advance!
>
> Best,
> Thiago
>

-- 
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/22bd52d7-2934-42d7-ae6a-9c2ca74be58b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: win_template always changing?

2016-02-29 Thread 'J Hawkesworth' via Ansible Project
Hi I have noticed this behaviour when running the windows integration 
tests.  As far as I can tell it is something that has started happening 
relatively recently.
What version of ansible are you using?

Many thanks,

Jon

On Monday, 29 February 2016 11:39:43 UTC, Chris Bennett wrote:
>
> Hi there, 
>
> I've just starting hitting some Windows hosts with Ansible & winrm and 
> when I use the win_template module, it changes every run: 
>
> conf: 
> == 
>   - name: Install nxlog.conf template 
> win_template: 
> src=templates/nxlog/nxlog.conf.tmpl 
> dest="c:\\Program Files (x86)\\nxlog\\conf\\nxlog.conf" 
> tags: 
>   - conf 
> notify: 
>   - restart nxlog 
>
> First run: 
> == 
>   $ date;  time ansible-playbook  -i inv -l svrexch13-01.victor.sa.gov.au 
> win-syslog.yml  --tags conf 
>   Mon Feb 29 22:06:54 ACDT 2016 
>
>   PLAY [win] 
> * 
>
>   TASK [Install nxlog.conf template] 
> * 
>   changed: [svrexch13-01.victor.sa.gov.au] 
>
>   PLAY RECAP 
> * 
>   svrexch13-01.victor.sa.gov.au : ok=1changed=1unreachable=0   
>  failed=0 
>
>
>   real0m16.140s 
>   user0m1.207s 
>   sys 0m0.203s 
>
> (confirmed config is correct on remote host) 
>
>
> Second run: 
> == 
>   $ date;  time ansible-playbook  -i inv -l svrexch13-01.victor.sa.gov.au 
> win-syslog.yml  --tags conf 
>   Mon Feb 29 22:07:19 ACDT 2016 
>
>   PLAY [win] 
> * 
>
>   TASK [Install nxlog.conf template] 
> * 
>   changed: [svrexch13-01.victor.sa.gov.au] 
>
>   PLAY RECAP 
> * 
>   svrexch13-01.victor.sa.gov.au : ok=1changed=1unreachable=0   
>  failed=0 
>
>
>   real0m16.150s 
>   user0m1.206s 
>   sys 0m0.192s 
>
>
> Has anyone else observed the same thing? 
>
> Thanks, 
>
> Chris 
>

-- 
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/ac827bf5-e50f-4947-b0e2-0e88f8c80863%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Ansible gets stuck during first npm install

2016-02-29 Thread Pablo Farías Navarro
I have the exact same problem.

Doing: 

- name: update node packages
  npm: path=/my-path

Makes the playbook get stuck, so I have to manually ssh and do npm install 
:s


On Sunday, November 29, 2015 at 1:55:51 PM UTC+10, an...@octonius.com wrote:
>
> Hi,
>
> Ansible gets stuck during execution of this task
>
> - name: install repo packages
>   become: yes
>   become_user: deploy
>   npm: path={{ app_repo_path }} state=present
>
>
> app_repo_path = /var/www/myApp
>
> I'm using ansible version 1.9.4. And deploying to rackspace servers.
>
> For the first time it hangs and I have to ssh into the server and run npm 
> install manually. Is there a workaround to this? Are there anybody out 
> there using ansible for production in deploying nodejs apps using ansible 
> npm module? 
> I also face other issues while doing bower install which initially failed 
> as root user cannot install bower packages and many times connection times 
> out in the server while installing thus the task fails. It would be great 
> to know how people handle these issues.
>
> Thanks in advance,
>

-- 
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/fd28dd91-3486-4348-b420-83d3841f6309%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] How to use --extra-vars option to pass host variables in ansible-playbook

2016-02-29 Thread Dinesh Sekar
No. I don't have idea in specifying it as dynamic inventory script or 
custom facts module.

Could you please provide me an examples or documentation.

On Monday, February 29, 2016 at 8:31:00 PM UTC+5:30, Tom Bamford wrote:
>
> On 29 Feb 2016, at 9:41 AM, Dinesh Sekar  
> wrote: 
> > 
> > Yes. If I give the arguments as below, then it would be normal variables 
> or global variables. 
> > 
> >  ansible-playbook -i hosts .yaml --extra-vars 
> '{"management_interface":{"int": "em0","ip": "192.168.56.3"}}' 
> > 
> > But I'm looking for an option in ansible-playbook where we could pass 
> the host variables specific to the particular host as follows. 
> > 
> >  ansible-playbook -i hosts .yaml --extra-vars 
> '{"hostvars['host1']":{"management_interface":{"int": "em0","ip": 
> "192.168.56.3"}}}' 
> > 
> > The content in hosts file is as below: 
> > 
> > [vdc1-host1] 
> > host1 
> > 
> > [vdc1-host2] 
> > host2 
> > 
> > [vdc1:children] 
> > vdc1-host1 
> > vdc1-host2 
> > 
> > [sites:children] 
> > vdc1 
> > 
> > [all:children] 
> > sites 
> > 
> > Please let me know if you have any queries. 
>
> Have you considered other ways of specifying that information, such as a 
> dynamic inventory script, or a custom facts module? 
>
> Tom

-- 
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/65e711f6-adff-4109-bdfd-45e9221ca1a6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] NameError: global name 'ssh_common_args' is not defined

2016-02-29 Thread Matt Martz
This should be resolved now.  You will need to update your git clone or
however you initially installed.

On Mon, Feb 29, 2016 at 4:48 AM, Krishna Kishore Bonagiri <
write2kish...@gmail.com> wrote:

> Hi,
>
>  I recently installed Ansible from github and was trying to start with the
> ping command, "ansible all -m ping -vvv"  but it is throwing this error. I
> could not find the reason, can someone please give a hint on why is it
> happening or  how to fix this?
>
> Using /home/kbonagir/ansible/ansible/ansible.cfg as config file
>  ESTABLISH CONNECTION FOR USER: None on PORT 22 TO localhost
> An exception occurred during task execution. The full traceback is:
> Traceback (most recent call last):
>   File
> "/home/kbonagir/ansible/ansible/lib/ansible/executor/task_executor.py",
> line 122, in run
> res = self._execute()
>   File
> "/home/kbonagir/ansible/ansible/lib/ansible/executor/task_executor.py",
> line 418, in _execute
> result = self._handler.run(task_vars=variables)
>   File
> "/home/kbonagir/ansible/ansible/lib/ansible/plugins/action/normal.py", line
> 33, in run
> results = merge_hash(results, self._execute_module(tmp=tmp,
> task_vars=task_vars))
>   File
> "/home/kbonagir/ansible/ansible/lib/ansible/plugins/action/__init__.py",
> line 440, in _execute_module
> tmp = self._make_tmp_path()
>   File
> "/home/kbonagir/ansible/ansible/lib/ansible/plugins/action/__init__.py",
> line 211, in _make_tmp_path
> result = self._low_level_execute_command(cmd, sudoable=False)
>   File
> "/home/kbonagir/ansible/ansible/lib/ansible/plugins/action/__init__.py",
> line 556, in _low_level_execute_command
> rc, stdout, stderr = self._connection.exec_command(cmd,
> in_data=in_data, sudoable=sudoable)
>   File
> "/home/kbonagir/ansible/ansible/lib/ansible/plugins/connection/paramiko_ssh.py",
> line 253, in exec_command
> super(Connection, self).exec_command(cmd, in_data=in_data,
> sudoable=sudoable)
>   File
> "/home/kbonagir/ansible/ansible/lib/ansible/plugins/connection/__init__.py",
> line 49, in wrapped
> self._connect()
>   File
> "/home/kbonagir/ansible/ansible/lib/ansible/plugins/connection/paramiko_ssh.py",
> line 141, in _connect
> self.ssh = SSH_CONNECTION_CACHE[cache_key] = self._connect_uncached()
>   File
> "/home/kbonagir/ansible/ansible/lib/ansible/plugins/connection/paramiko_ssh.py",
> line 212, in _connect_uncached
> sock_kwarg = self._parse_proxy_command(port)
>   File
> "/home/kbonagir/ansible/ansible/lib/ansible/plugins/connection/paramiko_ssh.py",
> line 152, in _parse_proxy_command
> if ssh_common_args is not None:
> NameError: global name 'ssh_common_args' is not defined
>
> localhost | FAILED! => {
> "failed": true,
> "msg": "Unexpected failure during module execution.",
> "stdout": ""
> }
>
> Thanks,
> Kishore
>
> --
> 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/3f2f89b1-fc76-406b-a3b8-ce1a823f5f06%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-aPewRBkqiDXPQZ2iOELLTTMfROu1A9-aOjSeAh3ubgA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


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

2016-02-29 Thread Julian Saunders
Yes you are right.  I tried running ConfigureRemotingForAnsible.ps1 but it 
failed.  I'm sorry I don't have the error message.

I have little experience of Powershell, but I managed to work through the 
script and run the individuals settings manually.  Of course I could have 
missed something, but it seemed to work fine with Ansible once I was part 
of the administrators group on the Windows host.

Luckily I have access to another Windows servers (server B), and for this 
the script ConfigureRemotingForAnsible.ps1 works.  Also I hadn't placed the 
user in the WinRMRemoteWMIUsers__ group.

Unfortunately I'm receiving the same errorr, and like with Server A, as 
soon as I add my user to the administrators group, all works fine. 

I've compared the WinRM settings across the two servers.  Server A was 
configured manually, and Server B via ConfigureRemotingForAnsible.ps1. 
 They are both the same:

Config
MaxEnvelopeSizekb = 500
MaxTimeoutms = 6
MaxBatchItems = 32000
MaxProviderRequests = 4294967295
Client
NetworkDelayms = 5000
URLPrefix = wsman
AllowUnencrypted = false
Auth
Basic = true
Digest = true
Kerberos = true
Negotiate = true
Certificate = true
CredSSP = false
DefaultPorts
HTTP = 5985
HTTPS = 5986
TrustedHosts
Service
RootSDDL = 
O:NSG:BAD:P(A;;GA;;;BA)(A;;GR;;;IU)S:P(AU;FA;GA;;;WD)(AU;SA;GXGW;;;WD)
MaxConcurrentOperations = 4294967295
MaxConcurrentOperationsPerUser = 1500
EnumerationTimeoutms = 24
MaxConnections = 300
MaxPacketRetrievalTimeSeconds = 120
AllowUnencrypted = false
Auth
Basic = true
Kerberos = true
Negotiate = true
Certificate = false
CredSSP = false
CbtHardeningLevel = Relaxed
DefaultPorts
HTTP = 5985
HTTPS = 5986
IPv4Filter = *
IPv6Filter = *
EnableCompatibilityHttpListener = false
EnableCompatibilityHttpsListener = false
CertificateThumbprint
AllowRemoteAccess = true
Winrs
AllowRemoteShellAccess = true
IdleTimeout = 720
MaxConcurrentUsers = 10
MaxShellRunTime = 2147483647
MaxProcessesPerShell = 25
MaxMemoryPerShellMB = 1024
MaxShellsPerUser = 30


Do we know if anyone that has got this working with a user that is *not* 
part of the administrators group? 


On Saturday, 27 February 2016 17:55:10 UTC, J Hawkesworth wrote:
>
> Thanks for this.
>
> Since ansible and pywinrm are behaving the same, it occurs to me that the 
> winrm configuration might not suit pywinrm. 
>
> From the above it appears you have created specific configuration for 
> winrm, rather than using the settings that are applied if you run the 
> ConfigureRemotingForAnsible.ps1.
>
> I suggest you run the  ConfigureRemotingForAnsible.ps1 script on a windows 
> host and then compare the winrm configuration with your test machine.
>
> You can see the winrm config by running
>
> Winrm get winrm/config
>
> From memory, pywinrm can not use credssp authorisation, 
>
> Is your test user a member of the WinRMRemoteWMIUsers__ group? I wouldn't 
> expect anything to work if not but just trying to understand what you have 
> in place. 
>
> Hope this helps, 
>
> Jon 
>
>

-- 
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/3e554e7c-289b-4032-8999-cd43e7c23ba2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Ansible API : Expand variables

2016-02-29 Thread amit bhagat
I have written a custom module "filter_prefix" that accepts "host" and 
"prefixes".

I have a dictionary that looks like this - 
d2 = {'4.4.4.4':'10.0.0.0/8','11.0.0.0/8', '5.5.5.5':'10.0.0.0/8'}

In the API script, I have -

hosts = d2.keys()
device_inventory = Inventory(hosts)

pb = Runner(
module_name = 'filter_prefix',
module_args = 'host={{ inventory_hostname }} prefixes= ???',
transport = local,
inventory = device_inventory)

I would like to be able to pass appropriate 'value'  to prefixes based on 
'host' from d2 dictionary. I tried using -
prefixes="d2[ '{{ inventory_hostname }}' ]" but then it doesn't expand d2.

I am running ansible version 1.9.2.

Any ideas?

Amit

-- 
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/75a9c353-cfb7-4955-8cec-6f3e15f29e46%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Unable to use "os_keypair" module, while "nova keypair-add" works

2016-02-29 Thread Thiago Martins
Hey guys!

 Ansible is AWESOME!:-D

 I'm planning to move away from running "shell:" via Ansible, in favor of 
native modules, but, it is not working, as follows...

 Can someone explain to me, why this task works:

---

- name: ubuntu | uploading SSH Keypair into OpenStack
  environment: "{{ demo_openrc_env }}"
  shell: nova keypair-add --pub-key "/home/{{ubuntu_user}}/.ssh/id_rsa.pub" 
default

---

 And why this does NOT work:

---

- name: ubuntu | uploading SSH Keypair into OpenStack
  environment: "{{ demo_openrc_env }}"
  os_keypair:
  state: present
  name: default
  public_key_file: "/home/{{ubuntu_user}}/.ssh/id_rsa.pub"---

---
ERROR:
-
TASK [os_user_key : ubuntu | uploading SSH Keypair into OpenStack] *
An exception occurred during task execution. To see the full traceback, use 
-vvv. The error was: AttributeError: 'OpenStackCloud' object has no attribute 
'get_keypair'
fatal: [localhost]: FAILED! => {"changed": false, "failed": true, "parsed": 
false}

---

 What am I missing? Appending "-vvv" doesn't help either...

 I also tried to use the "clouds:" entry of "os_keypair" but, also, doesn't 
work... It doesn't find "mycloud", even if clouds.yml is there on same dir 
of task... So, I'll prefer for now, to use "environment:", if possible...

 Any clues?

 Thanks in advance!

Best,
Thiago

-- 
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/919ba1ba-043b-4d0d-98bd-6b73c0254406%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Use requirements.yml in a lookup?

2016-02-29 Thread Johan
Hello!

I would like to take my requirements.yml and make a config for 
https://github.com/beefsack/git-mirror

Any idea for how to accomplish this? I thought about using a lookup 
somehow, but with requirements.yml already being YAML maybe there is a 
better way?

Basically I'd like to take each "src: https://github../role-1; in 
requirements.yml and turn into a file that looks like:


ListenAddr = ":8080"
BasePath = "/var/mirror"
Interval = "15m"

[repo]
Origin = "https://github../role-1;

[repo]
Origin = "https://github../role-2;


// Johan

-- 
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/14dcd4d9-55be-4feb-9df3-7b2b0ae4d6c9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] delegate_to not working after fix released

2016-02-29 Thread zoltan . sandor
Hello,

Experiencing issues with delegate_to in ansible 2.0, after some research I 
found the ticket https://github.com/ansible/ansible/issues/12127 where my 
issues is described exactly. 
I noticed today that the fix was released in v 2.0.1.0, upgraded my ansible 
but experience the same issue.

 ESTABLISH SSH CONNECTION FOR USER: None
 SSH: EXEC ssh -C -vvv -o ControlMaster=auto -o 
ControlPersist=30m -o ForwardAgent=yes -F /etc/ansible/ssh.config -q -o 
StrictHostKeyChecking=no -o KbdInteractiveAuthentication=no -o 
PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey 
-o PasswordAuthentication=no -o ConnectTimeout=10 -o 
'ControlPath=~/.ssh/mux-%r@%h:%p' tag_Name_stage_haproxy '/bin/sh -c 
'"'"'sudo -H -S -n -u root /bin/sh -c '"'"'"'"'"'"'"'"'echo 
BECOME-SUCCESS-dbewvkmyvbwulbfgkhgrzaxhdvldapgz; /bin/sh -c 
'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'LANG=C LC_ALL=C 
LC_MESSAGES=C 
/usr/bin/python'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"''"'"'"'"'"'"'"'"''"'"''
fatal: [10.0.80.64]: UNREACHABLE! => {"changed": false, "msg": "SSH Error: 
data could not be sent to the remote host. Make sure this host can be 
reached over ssh", "unreachable": true}


$ ansible --version
ansible 2.0.1.0

Need to mention that I use aws tags in my delegation, maybe related ?

Any suggestion on how to make this work would be appreciated, it's really 
causing problems in our automation because it prevents us to remove/add 
machine in haproxy when we deploy.

Thank you,
Zoltan.

-- 
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/82152e01-eac8-474d-b8fc-23beff36fcce%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Prevent caching when calling ansible 2.0 from Python API

2016-02-29 Thread max . wiegand82
Hi all,

our general setup is based on the idea to have an ansible environment with 
roles and vars and everything, that can be used
both by command line and also programatically from python. It was quite 
easy with ansible 1.9, but i struggle to get it with
newer ansible 2.0.
Here is the point, i can't get fixed:

In python:

*from ansible.cli.playbook import **
*from ansible.executor.playbook_executor import **
*from ansible.utils.vars import combine_vars*

*my_cli=PlaybookCLI(['', 
'/amplay/reboot.yml','-i','/amplay/hosts','-l','nuc5'])*
*my_cli.parse()*
*results=my_cli.run()*


Output:

*PLAY [Start Protected] 
**

*TASK [twist-protected : include] 

*included: /amplay/roles/twist-protected/tasks/start-protected.yml for nuc5*

*TASK [twist-protected : Workaround delegate_to user name problem] 
***
*ok: [nuc5]*

*TASK [twist-protected : Check Twistprotected] 
***
*ok: [nuc5 -> localhost]*

*.*


Now i run the same code a second time:


*my_cli=PlaybookCLI(['', 
'/amplay/reboot.yml','-i','/amplay/hosts','-l','nuc5'])*
*my_cli.parse()*
*results=my_cli.run()*


Output:

*PLAY [Start Protected] 
**

*TASK [twist-protected : include] 

*included: /amplay/roles/twist-protected/tasks/start-protected.yml for nuc5*

*TASK [twist-protected : include] 

*included: /amplay/roles/twist-protected/tasks/setup-proxy.yml for nuc5*

*.*


It does not execute the tasks, but just skips without any message!
Apparently there is some caching or similar, that tells ansible not to 
repeat the execution of the playbook.
This might make sense for some scenarios, but how can i switch it off? I 
tried with `flush-cache` cmd line
option, but that didn't change anything.

Any hints?


-- 
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/2b63c39e-29d5-4d3d-87b6-02e8f1654a46%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] NameError: global name 'ssh_common_args' is not defined

2016-02-29 Thread Krishna Kishore Bonagiri
Hi,

 I recently installed Ansible from github and was trying to start with the 
ping command, "ansible all -m ping -vvv"  but it is throwing this error. I 
could not find the reason, can someone please give a hint on why is it 
happening or  how to fix this?

Using /home/kbonagir/ansible/ansible/ansible.cfg as config file
 ESTABLISH CONNECTION FOR USER: None on PORT 22 TO localhost
An exception occurred during task execution. The full traceback is:
Traceback (most recent call last):
  File 
"/home/kbonagir/ansible/ansible/lib/ansible/executor/task_executor.py", 
line 122, in run
res = self._execute()
  File 
"/home/kbonagir/ansible/ansible/lib/ansible/executor/task_executor.py", 
line 418, in _execute
result = self._handler.run(task_vars=variables)
  File 
"/home/kbonagir/ansible/ansible/lib/ansible/plugins/action/normal.py", line 
33, in run
results = merge_hash(results, self._execute_module(tmp=tmp, 
task_vars=task_vars))
  File 
"/home/kbonagir/ansible/ansible/lib/ansible/plugins/action/__init__.py", 
line 440, in _execute_module
tmp = self._make_tmp_path()
  File 
"/home/kbonagir/ansible/ansible/lib/ansible/plugins/action/__init__.py", 
line 211, in _make_tmp_path
result = self._low_level_execute_command(cmd, sudoable=False)
  File 
"/home/kbonagir/ansible/ansible/lib/ansible/plugins/action/__init__.py", 
line 556, in _low_level_execute_command
rc, stdout, stderr = self._connection.exec_command(cmd, 
in_data=in_data, sudoable=sudoable)
  File 
"/home/kbonagir/ansible/ansible/lib/ansible/plugins/connection/paramiko_ssh.py",
 
line 253, in exec_command
super(Connection, self).exec_command(cmd, in_data=in_data, 
sudoable=sudoable)
  File 
"/home/kbonagir/ansible/ansible/lib/ansible/plugins/connection/__init__.py", 
line 49, in wrapped
self._connect()
  File 
"/home/kbonagir/ansible/ansible/lib/ansible/plugins/connection/paramiko_ssh.py",
 
line 141, in _connect
self.ssh = SSH_CONNECTION_CACHE[cache_key] = self._connect_uncached()
  File 
"/home/kbonagir/ansible/ansible/lib/ansible/plugins/connection/paramiko_ssh.py",
 
line 212, in _connect_uncached
sock_kwarg = self._parse_proxy_command(port)
  File 
"/home/kbonagir/ansible/ansible/lib/ansible/plugins/connection/paramiko_ssh.py",
 
line 152, in _parse_proxy_command
if ssh_common_args is not None:
NameError: global name 'ssh_common_args' is not defined

localhost | FAILED! => {
"failed": true,
"msg": "Unexpected failure during module execution.",
"stdout": ""
}

Thanks,
Kishore

-- 
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/3f2f89b1-fc76-406b-a3b8-ce1a823f5f06%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Ansible 2.0.1 OpenStack network module issue with static IP's

2016-02-29 Thread David Shrewsbury
You should be able to use the os_port.py module to first create a port with 
your static IP.
Then use the port ID returned by setting 'port-id' in the 'nics' parameter 
of the os_server.py
module.

This method assumes you have a neutron service running. Supporting nova 
networking only
would require some work on the module and maybe within the shade library, 
as well.

-David


On Saturday, February 27, 2016 at 11:25:18 AM UTC-5, spankt...@gmail.com 
wrote:
>
> Apparently the latest 2.0.1 modules for OpenStack doesn't have a way to 
> set static IP's (that arent floating IP's) during VM creation - this is 
> critical functionality for OpenStack installations that do not provide 
> automatic DNS service and have to provide indepedent, non automatic DNS 
> service. The static IP's are using to be able to provide DNS names 
> reliably. If there's a way to achieve that, please let me know, otherwise, 
> are there any plans to provide this vey basic yet missing functionality?
>

-- 
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/68aeb2a4-0f5f-4871-aa98-df635b1bcf31%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Ansible networking preview update 2.0.0-0.2 is available

2016-02-29 Thread James Cammarata
Hi Everyone,

As you undoubtedly heard we released the first version of Ansible 2.0 with
networking support as a technology preview at AnsibleFest London.  In case
you missed the announcement, details can be found here (
http://www.redhat.com/en/about/press-releases/red-hat-brings-devops-network-new-ansible-capabilities)
and here (https://www.ansible.com/network-automation).

Today, we are releasing Ansible 2.0 Network Technology Preview 2 which
addresses several bugs from the original release:

* Fixes bugs when using EOS and NXOS API which would cause some modules to
  generate an exception
* Updates the keys return from JUNOS modules to be consistent with all
  other networking modules.
* Fix for authentication bug when using RSA keys and the CLI transport

The latest release is immediately available at releases.ansible.com.  We
are going to continue to distribute the network technology preview only via
releases.ansible.com until it is merged into Ansible 2.1.

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/CAMFyvFimAhU%3DYAFyabHa3PCSjsY1bF44Xrg-n-bF%3DqWsGTu%3D0g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] How to use --extra-vars option to pass host variables in ansible-playbook

2016-02-29 Thread Tom Bamford
On 29 Feb 2016, at 9:41 AM, Dinesh Sekar  wrote:
> 
> Yes. If I give the arguments as below, then it would be normal variables or 
> global variables. 
> 
>  ansible-playbook -i hosts .yaml --extra-vars 
> '{"management_interface":{"int": "em0","ip": "192.168.56.3"}}'
> 
> But I'm looking for an option in ansible-playbook where we could pass the 
> host variables specific to the particular host as follows.
> 
>  ansible-playbook -i hosts .yaml --extra-vars 
> '{"hostvars['host1']":{"management_interface":{"int": "em0","ip": 
> "192.168.56.3"}}}'
> 
> The content in hosts file is as below:
> 
> [vdc1-host1]
> host1
> 
> [vdc1-host2]
> host2
> 
> [vdc1:children]
> vdc1-host1
> vdc1-host2
> 
> [sites:children]
> vdc1
> 
> [all:children]
> sites
> 
> Please let me know if you have any queries.

Have you considered other ways of specifying that information, such as a 
dynamic inventory script, or a custom facts module?

Tom

-- 
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/F96E6B3E-466D-4D49-BC57-F604B93F1C3F%40atplanet.co.za.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Galaxy 2.0.1 Release

2016-02-29 Thread Chris Houseknecht
Galaxy upgrade completed. w00t!

--c

On Friday, February 26, 2016 at 10:36:16 AM UTC-5, Chris Houseknecht wrote:
>
> Smarter people than me pointed out that Monday morning would be better. 
> They may be right. Galaxy 2.0.1 will release Monday morning at 7:30AM EST. 
>
> --c
>
> On Friday, February 26, 2016 at 7:43:06 AM UTC-5, Chris Houseknecht wrote:
>>
>> False start. We're having some jenkins issues. Delaying until this 
>> evening at 6:00 PM EST.  Stay tuned!
>>
>>
>> --Chris
>>
>> On Friday, February 26, 2016 at 7:28:02 AM UTC-5, Chris Houseknecht wrote:
>>>
>>> Starting the upgrade...
>>>
>>> On Tuesday, February 23, 2016 at 12:54:57 PM UTC-5, Chris Houseknecht 
>>> wrote:

 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/c8f649cc-06a5-4bee-b006-f6843f2db11a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] win_template always changing?

2016-02-29 Thread Chris Bennett
Hi there,

I've just starting hitting some Windows hosts with Ansible & winrm and
when I use the win_template module, it changes every run:

conf:
==
  - name: Install nxlog.conf template
win_template:
src=templates/nxlog/nxlog.conf.tmpl
dest="c:\\Program Files (x86)\\nxlog\\conf\\nxlog.conf"
tags:
  - conf
notify:
  - restart nxlog

First run:
==
  $ date;  time ansible-playbook  -i inv -l svrexch13-01.victor.sa.gov.au 
win-syslog.yml  --tags conf
  Mon Feb 29 22:06:54 ACDT 2016

  PLAY [win] 
*

  TASK [Install nxlog.conf template] 
*
  changed: [svrexch13-01.victor.sa.gov.au]

  PLAY RECAP 
*
  svrexch13-01.victor.sa.gov.au : ok=1changed=1unreachable=0failed=0


  real0m16.140s
  user0m1.207s
  sys 0m0.203s

(confirmed config is correct on remote host)


Second run:
==
  $ date;  time ansible-playbook  -i inv -l svrexch13-01.victor.sa.gov.au 
win-syslog.yml  --tags conf
  Mon Feb 29 22:07:19 ACDT 2016

  PLAY [win] 
*

  TASK [Install nxlog.conf template] 
*
  changed: [svrexch13-01.victor.sa.gov.au]

  PLAY RECAP 
*
  svrexch13-01.victor.sa.gov.au : ok=1changed=1unreachable=0failed=0


  real0m16.150s
  user0m1.206s
  sys 0m0.192s


Has anyone else observed the same thing?

Thanks,

Chris

-- 
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/20160229113922.GA18453%40cgb-linux.rcmb.lan.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Ansible docker module does not allow me to use bind mode :Z

2016-02-29 Thread ishan jain
When i try to run the following task:

- name: start docker container
  docker:
name: container
image: img
state: started
   expose:
  - 8301:8182
   volumes:
  - /mydata/folder:/opt/mydata/:Z


Ansible poses an error - {"changed": false, "failed": true, "msg": "bind 
mode needs to either be \"ro\" or \"rw\""}

I was facing a lot of issues with volumes earlier when i was using :ro 
(manual deployment) which went away after simply using :Z. Now ansible is 
not letting me use it and the same images are posing errors when starting. 
Can you please tell me why it is not allowed and how to come around this 
thing ?

-- 
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/8ba2a68d-5759-4aa4-9f62-0e207215fb8a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Ansible windows modules

2016-02-29 Thread Stavros
Hi Quang,

you can also try to extract the x64-Windows8.1-KB2934520-x64.msu, which 
will give you the Windows8.1-KB2934520-x64.cab. For the installation try 
this:

DISM.exe /Online /Add-Package /PackagePath:C:\Temp\Windows8.1-KB2934520-x64.cab 
/NoRestart /Quiet


You'll have to reboot the server after the installation, so it's up to you 
to set the /NoRestart parameter...or not..

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/6d0ce3c3-39e5-442a-8a24-f949c11186e3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.