Re: [ansible-project] lining up users when bootstrapping a system

2015-11-12 Thread Brian Coca
try:

- hosts: boxens
  remote_user: root
  tasks:
- yum: name={{ item }} state=present
  with_items: packages
- command: "puppet agent --noop --server={{ puppetmaster }}"
- command: "puppet cert sign {{ ansible_fqdn }}"
  delegate_to: "{{ puppetmaster }}"
  remote_user: "{{lookup('env','USER')}}"

or just set your own user name directly.

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


Re: [ansible-project] 2.0 host key check issues

2015-11-12 Thread Brian Coca
2.0 does not lock known_hosts for updating ssh keys, 1.9 does, it is a
difficult issue as it needs to be locked to be consistent, but can end
up serializing the plays.


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


Re: [ansible-project] Solaris and pfexec, not working?

2015-11-12 Thread Brian Coca
1.9 had a skeleton for pfexec support but we never got to test it, it
is now available in 2.0 which is current devel and close to release.

If you really want to test with 1.9, you need to update the following
in the ssh.py or paramiko_ssh.py connection plugin (whichever you are
using).

 self.become_methods_supported=['sudo', 'su', 'pbrun']

should look like:

 self.become_methods_supported=['sudo', 'su', 'pbrun', 'pfexec']

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


Re: [ansible-project] 2.0 host key check issues

2015-11-12 Thread Alex Leonhardt
I'd try running 1.9 against the very same host and see what happens, also,
adding - may give some idea what's happening too .. it may just be a
new config setting somewhere ... this may be relevant too tho :
https://github.com/ansible/ansible/issues/3694#issuecomment-22530734

Alex


On 13 November 2015 at 01:05, Guy Knights  wrote:

> I've noticed since I upgraded to 2.0 that something is wrong with host key
> checks when running ansible-playbook. Previously, under 1.9, if
> ansible-playbook encountered an unknown host key during the setup phase, it
> was present the standard OpenSSH host key prompt and pause to wait for user
> input. However, since 2.0 it now seems to continue with the next host even
> without any user input. This seems to cause issues as the run progresses
> and either causes the run to hang, or it just fails for the hosts with
> unknown keys. I have seen it wait at the prompt properly from time to time,
> but mostly I see the behaviour I just described.
>
> Has anyone else noticed this 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/07a0-fd12-419e-84c4-91005532066a%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 

gpg public key: http://dpaste.com/1CEJ38Z

-- 
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/CACSH3MvMu7ma6n686Y6Cd8hEM%3DouUzdzz2%3DPNMr-Rwib%3DW6L9g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] msg: hostname module cannot be used on platform Linux (Centos linux)

2015-11-12 Thread Greg Swift
So I have no idea why the ostname module would be behaving like that.
Looking at the module it has lots of distribution coverage.  I just tested
hostname on ansible 1.9.4 and

"ansible_distribution": "CentOS", "ansible_distribution_major_version":
"7", "ansible_distribution_release": "Core",
"ansible_distribution_version": "7.1.1503",

-greg

On Thu, Nov 12, 2015 at 9:51 PM Greg Swift  wrote:

> Fwiw, i built this role against centos7 and just ran it fresh against an
> updated box monday. I'm gonna check it again now that i saw this.
>
> --
> 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/29610778-7298-4161-acdc-68e048c13050%40googlegroups.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CACB_2GZCBQNSJ3_OE98T-z2Nfa6mwHf60MutXUS517exggvTsA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Iterate over complex dicitonary structure in j2 tempalte

2015-11-12 Thread Alex Leonhardt
Hi,

this may help:
https://docs.ansible.com/ansible/playbooks_loops.html#looping-over-subelements
https://docs.ansible.com/ansible/playbooks_loops.html#looping-over-hashes

Alex


On 13 November 2015 at 05:26, Hristo Stoyanov  wrote:

> Sorry if this has been documented elsewhere (where?), but how can one
> iterate with jinja2 over a dictionary?
>
>
> http://stackoverflow.com/questions/33666820/ansible-jinja2-loops-over-complex-structures
>
> You can ask here or in stackoverflow.
>
> Thanks
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ansible-project+unsubscr...@googlegroups.com.
> To post to this group, send email to ansible-project@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/28bc59f9-ff76-4c65-b6cc-44521f53cc03%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 

gpg public key: http://dpaste.com/1CEJ38Z

-- 
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/CACSH3MvVQBpZ_E%3DUqVG3Pv-fp67Lj%3DukE8TPK3U7ENZ8WraA1Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Variable name includes a variable

2015-11-12 Thread Brian Coca
mustaches don't stack, to do dynamic vars you need to use hostvars:

  - debug: msg="interface = {{item}}, address = {{
hostvars[inventory_hostname]['ansible_' + item].ipv4.address }}
with_items: ansible_interfaces
when: 'item != "lo"'

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


[ansible-project] Re: Role do something after handler?

2015-11-12 Thread Ulrich Hochholdinger
Hi,
xou can write a handler for every single Action, and notify all desired 
handlers when needed. Handlers are executed in the order inside the 
handlers list.

theoretical example:

tasks:
   - name: change config
 action: do something
 notify:
  - enable_handler
  - reload_handler
  - start_handler
 

handlers:
   - name: reload_handler
 service: name=daemon state=reloaded
   - name: enable_handler
 service: name=daemon enabled=yes
   - name: start_handler
 service: name=daemon state=restarted   


=> the handlers are executed in the order of the handlers list as reload .. 
enable .. start independend of the order in the notify list. ;-)

Cheers 
 Ulli

Am Mittwoch, 11. November 2015 19:41:34 UTC+1 schrieb Dylan Martin:
>
> Hi all, I have a strange one that I hope you can help me with.
>
> I'm trying to make a role for systemd service unit files.  This is the 
> newfangled replacement for good ol' sysV init scripts in Rhel7, any recent 
> Fedora and a lot of other linux distros.
>
> The workflow is supposed to go something like this.
>
> 1) edit/install a unit file, like /etc/systemd/system/myservice.service
> 2) run systemctl daemon-reload 
> 3) run systemctl enable myservice
> 4) run systemctl start myservice
>
> daemon-reload tells the systemd daemon to re-read the unit files so it 
> will know you changed something
>
> In ansible, I interpret that as looking like
>
> 1) template out unit file
> 2) notify daemon-reload handler if unit file changed
> 3) service enable=true state=started name=myservice
>
> The problem is, if I've changed the unit file, the daemon-reload runs 
> after the service enable/start, so systemd doesn't know to re-read the unit 
> file before trying to start/enable the service.
>
> I could just make it run daemon-reload every time the role runs, which 
> kindof sucks.  Also, if I'm installing a boatload of unit files, I'd like 
> to do a daemon-reload only once to get them all.  I could make the 
> daemon-reload a normal task that only runs when the template changes, but 
> that means I'd be running the daemon-reload once for every unit file, which 
> sucks in the case where I'm installing a boatload of them.  I looked at 
> post_task, but that's not for roles.  
>
> Does anyone know a good way to do this?
>
> Thanks!
> -Dylan
>

-- 
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/295f3eff-fb8d-4fb7-b4f6-95c43873181e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Role do something after handler?

2015-11-12 Thread Ulrich Hochholdinger
Hi,
xou can write a handler for every single Action, and notify all desired 
handlers when needed. Handlers are executed in the order inside the 
handlers list.

theoretical example:

tasks:
   - name: change config
 action: do something
 notify:
  - enable_handler
  - reload_handler
  - start_handler
 

handlers:
   - name: reload_handler
 service: name=daemon state=reloaded
   - name: enable_handler
 service: name=daemon enabled=yes
   - name: start_handler
 service: name=daemon state=restarted   


=> the handlers are executed in the order of the handlers list as reload .. 
enable .. start independend of the order in the notify list. ;-)

Cheers 
 Ulli

Am Mittwoch, 11. November 2015 19:41:34 UTC+1 schrieb Dylan Martin:
>
> Hi all, I have a strange one that I hope you can help me with.
>
> I'm trying to make a role for systemd service unit files.  This is the 
> newfangled replacement for good ol' sysV init scripts in Rhel7, any recent 
> Fedora and a lot of other linux distros.
>
> The workflow is supposed to go something like this.
>
> 1) edit/install a unit file, like /etc/systemd/system/myservice.service
> 2) run systemctl daemon-reload 
> 3) run systemctl enable myservice
> 4) run systemctl start myservice
>
> daemon-reload tells the systemd daemon to re-read the unit files so it 
> will know you changed something
>
> In ansible, I interpret that as looking like
>
> 1) template out unit file
> 2) notify daemon-reload handler if unit file changed
> 3) service enable=true state=started name=myservice
>
> The problem is, if I've changed the unit file, the daemon-reload runs 
> after the service enable/start, so systemd doesn't know to re-read the unit 
> file before trying to start/enable the service.
>
> I could just make it run daemon-reload every time the role runs, which 
> kindof sucks.  Also, if I'm installing a boatload of unit files, I'd like 
> to do a daemon-reload only once to get them all.  I could make the 
> daemon-reload a normal task that only runs when the template changes, but 
> that means I'd be running the daemon-reload once for every unit file, which 
> sucks in the case where I'm installing a boatload of them.  I looked at 
> post_task, but that's not for roles.  
>
> Does anyone know a good way to do this?
>
> Thanks!
> -Dylan
>

-- 
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/db9d78e3-e188-4295-9765-b18ffb85c1d6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Iterate over complex dicitonary structure in j2 tempalte

2015-11-12 Thread Hristo Stoyanov
Sorry if this has been documented elsewhere (where?), but how can one 
iterate with jinja2 over a dictionary?

http://stackoverflow.com/questions/33666820/ansible-jinja2-loops-over-complex-structures

You can ask here or in stackoverflow.

Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/28bc59f9-ff76-4c65-b6cc-44521f53cc03%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] msg: hostname module cannot be used on platform Linux (Centos linux)

2015-11-12 Thread Greg Swift
Fwiw, i built this role against centos7 and just ran it fresh against an 
updated box monday. I'm gonna check it again now that i saw this. 

-- 
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/29610778-7298-4161-acdc-68e048c13050%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] 2.0 host key check issues

2015-11-12 Thread Guy Knights
I've noticed since I upgraded to 2.0 that something is wrong with host key 
checks when running ansible-playbook. Previously, under 1.9, if 
ansible-playbook encountered an unknown host key during the setup phase, it 
was present the standard OpenSSH host key prompt and pause to wait for user 
input. However, since 2.0 it now seems to continue with the next host even 
without any user input. This seems to cause issues as the run progresses 
and either causes the run to hang, or it just fails for the hosts with 
unknown keys. I have seen it wait at the prompt properly from time to time, 
but mostly I see the behaviour I just described.

Has anyone else noticed this 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/07a0-fd12-419e-84c4-91005532066a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] How to ignore invalid tag name instead of throwing a error

2015-11-12 Thread yikaus
Hi , 

I got the requirement to ignore the invalid tag name when execute a 
playbook 

eg .   ansible-playbook -t tag1 test.yml 

and I will get below error and fail the playbook

ERROR: tag(s) not found in playbook: tag1.  


What I expect is doing nothing if tag name is not exist  just like --skip-tags 
all


PLAY [localhost] 
** 


PLAY RECAP 
 



If anyway I can do that ? 


Thanks 


-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/f2915fc9-90af-47fd-b03e-9eeb77cf2aa7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Variable name includes a variable

2015-11-12 Thread mtovey

 This is something I have been struggling with for a while: a variable 
whose name includes a variable.  For instance, Ansible facts for a server 
includes the following information on the network interfaces:

"ansible_eth0": {
"active": true,
"device": "eth0",
"ipv4": {
"address": "10.105.12.24",
"netmask": "255.255.252.0",
"network": "10.105.12.0"
},
"macaddress": "00:50:56:92:3c:b2",
"module": "vmxnet3",
"mtu": 1500,
"promisc": false,
"type": "ether"
},
"ansible_eth1": {
"active": true,
"device": "eth1",
"ipv4": {
"address": "10.104.24.25",
"netmask": "255.255.255.248",
"network": "10.104.24.24"
},
"macaddress": "00:50:56:92:6a:40",
"module": "vmxnet3",
"mtu": 1500,
"promisc": false,
"type": "ether"
},
"ansible_interfaces": [
"lo",
"eth1",
"eth0"
],

In a playbook, I want to walk through the list of interfaces and extract 
information about each one:

  - debug: msg="interface = {{item}}, address = 
{{ansible_{{item}}.ipv4.address}}
  with_items: ansible_interfaces
  when: 'item != "lo"'

This, of course, does not work because of the nested delimiters.  So how do 
I call out something like this?
-Mark

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/54612f0b-cc6f-4c72-9d9c-02c1bc466966%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: Troubleshooting Windows Host UNREACHABLE!

2015-11-12 Thread J Hawkesworth
Is this machine Server 2008 R2 by any chance?  WMF 3.0 had an irritating 
bug where it would allocate a tiny memory quota for winrm so things would 
fail a lot.  Hotfix for the fix as described in the blue box here: 
http://docs.ansible.com/ansible/intro_windows.html#windows-system-prep

Just comparing my winrm get winrm/config/service with yours and my last 
line states

'AllowRemoteAccess = true' - do you have that?

Jon


On Thursday, November 12, 2015 at 7:04:29 PM UTC, Matt Calhoun wrote:
>
> I see a sucessful connection listed in the event logs, and in my original 
> post demonstrated that I could telnet in on the WinRM port, so no firewall 
> blocking. There is also no proxy or anything in between. I can connect to 
> over 100 different servers, many on the same subnet as myhost, but this is 
> the only one giving me trouble.
>
> On Thu, Nov 12, 2015 at 1:19 PM, J Hawkesworth  > wrote:
>
>> try hitting it again with ansible and check the event logs for any 
>> evidence of a login attempt.
>>
>> if its not getting that far... is there a proxy between controller and 
>> windows host (guessing a bit here, not much experience with proxies)?
>>
>> possibly firewall rules kicking in?  bear in mind different profiles 
>> which may or may not be affecting connection from controller to windows 
>> target differently from windows to windows
>>
>> will try and think of more ideas.
>>
>>
>> On Thursday, November 12, 2015 at 1:58:18 PM UTC, Matt Calhoun wrote:
>>>
>>> I have verified that PSRemoting seems to be working fine on this host. 
>>> From another windows box...
>>>
>>> PS C:\> Invoke-Command -ComputerName myhost -port 5985 -Authentication 
>>> Kerberos -ScriptBlock { Get-Content c:\windows\system32\drivers\etc\hosts 
>>>  } -credential myaccount
>>> 
>>>
>>> # Copyright (c) 1993-2009 Microsoft Corp.
>>> #
>>> # This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
>>> #
>>> # This file contains the mappings of IP addresses to host names. Each
>>> # entry should be kept on an individual line. The IP address should
>>> # be placed in the first column followed by the corresponding host name.
>>> # The IP address and the host name should be separated by at least one
>>> # space.
>>> #
>>> # Additionally, comments (such as these) may be inserted on individual
>>> # lines or following the machine name denoted by a '#' symbol.
>>> #
>>> # For example:
>>> #
>>> #  102.54.94.97 rhino.acme.com  # source server
>>> #   38.25.63.10 x.acme.com  # x client host
>>>
>>> # localhost name resolution is handled within DNS itself.
>>> #   127.0.0.1   localhost
>>> #   ::1 localhost
>>>
>>>
>>> -- 
>> You received this message because you are subscribed to a topic in the 
>> Google Groups "Ansible Project" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/ansible-project/ZebLwqaxYpo/unsubscribe
>> .
>> To unsubscribe from this group and all its topics, send an email to 
>> ansible-proje...@googlegroups.com .
>> To post to this group, send email to ansible...@googlegroups.com 
>> .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/ansible-project/0433d886-3b8b-413a-ae39-3c0f1c2b65a3%40googlegroups.com
>>  
>> 
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/aeeb0862-d99b-4a33-9750-74f585d94f5c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: Connecting to existing ec2 instances

2015-11-12 Thread Brian Coca
run ansible with -v and you should see the full ssh command used,
that should point at a key, if not you likely have an agent or the ssh
user/password info in inventory.



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


[ansible-project] Re: Connecting to existing ec2 instances

2015-11-12 Thread nathan chu
My existing instances are provisioned thusly:

  tasks:
- name: Provision an instance
  ec2: >
aws_access_key={{ec2_access_key}}
aws_secret_key={{ec2_secret_key}}
keypair={{mykeypair}}
group_id={{security_group}}
instance_type={{instance_type}}
image={{image}}
region={{region}}
wait=true
count=1
vpc_subnet_id={{ subnet_name }}
instance_tags='{"Name":"{{ name }}","InternalName":"{{ 
internal_name }}"}'
  register: ec2_info

- debug: var=ec2_info

- debug: var=item
  with_items: ec2_info.instance_ids

- debug: var=item
  with_items: ec2_info.instances

- name: add host to host list
  add_host: hostname={{ item.public_ip }} groupname=ec2hosts
  with_items: ec2_info.instances

- name: wait for instances to listen on port:22
  wait_for:
state=started
host={{ item.private_dns_name }}
port=22
  with_items: ec2_info.instances

- hosts: ec2hosts
  gather_facts: True
  user: ec2-user
  sudo: True
  roles:
- { role: common, XXXextra instance variablesXXX }<--- this role 
(in main.yml) calls a number of scripts and shell commands on the 
instance.  How can it connect? and how can I replicate that connection?


On Thursday, November 12, 2015 at 5:10:18 PM UTC-5, nathan chu wrote:
>
> *typo:  not --> now.  there's a nice one-letter semantic change, lol.
>
>
>
>
> On Thursday, November 12, 2015 at 4:38:16 PM UTC-5, nathan chu wrote:
>>
>> Hi,
>>
>> I recently inherited an Ansible deployment that manages some EC2 
>> instances and I have a couple questions.  I am unable to find a pem 
>> file/ssh key on the local file system, but somehow Ansible is able to 
>> connect to the instances it creates and run shell scripts.  How is this 
>> possible?  I'm* now *trying to enhance the existing playbooks to update 
>> some data via a script on a central/master server in our deployment every 
>> time we create a new instance, but I'm having trouble connecting to the 
>> instance.  How can I use whatever mechanism is in place for the recently 
>> provisioned instances to access this single (relatively static) instance?
>>
>> Thanks,
>>
>>
>> Nate
>>
>

-- 
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/e0b8e5af-7d89-495b-9c11-c6df5ea0a6c6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Connecting to existing ec2 instances

2015-11-12 Thread nathan chu
*typo:  not --> now.  there's a nice one-letter semantic change, lol.




On Thursday, November 12, 2015 at 4:38:16 PM UTC-5, nathan chu wrote:
>
> Hi,
>
> I recently inherited an Ansible deployment that manages some EC2 instances 
> and I have a couple questions.  I am unable to find a pem file/ssh key on 
> the local file system, but somehow Ansible is able to connect to the 
> instances it creates and run shell scripts.  How is this possible?  I'm* 
> now *trying to enhance the existing playbooks to update some data via a 
> script on a central/master server in our deployment every time we create a 
> new instance, but I'm having trouble connecting to the instance.  How can I 
> use whatever mechanism is in place for the recently provisioned instances 
> to access this single (relatively static) instance?
>
> Thanks,
>
>
> Nate
>

-- 
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/59ba986f-eee1-4cf8-8872-0cbccb8b6e18%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Connecting to existing ec2 instances

2015-11-12 Thread nathan chu
Hi,

I recently inherited an Ansible deployment that manages some EC2 instances 
and I have a couple questions.  I am unable to find a pem file/ssh key on 
the local file system, but somehow Ansible is able to connect to the 
instances it creates and run shell scripts.  How is this possible?  I'm not 
trying to enhance the existing playbooks to update some data via a script 
on a central/master server in our deployment every time we create a new 
instance, but I'm having trouble connecting to the instance.  How can I use 
whatever mechanism is in place for the recently provisioned instances to 
access this single (relatively static) instance?

Thanks,


Nate

-- 
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/9f8e8ec9-484b-4a52-975b-448af0a16f43%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Ansible WinRM shows 401 Unauthorized when pywinrm works with no problem

2015-11-12 Thread kevin . e . kenny
Try changing:

ansible_ssh_password=ansible

to

ansible_ssh_pass=ansible

That tripped me up with 1.9.4.

Same thing would apply to your windows.yml.

Kev


On Wednesday, October 21, 2015 at 5:48:13 PM UTC+1, Tianwei Liu wrote:
>
> Hi,
>
> I am having this weird problem that my ansible will always show 401 error 
> when trying to connect my windows machine via winrm. Although I can use 
> pywinrm with no problem at all authenticating with the exact same account 
> and password.
>
> My inventory:
> [windows]
> 192.168.2.3
>
> [windows:vars]
> ansible_ssh_user=ansible
> ansible_ssh_password=ansible
> ansible_ssh_port=5986
> ansible_connection=winrm
>
> I can run the example from: https://github.com/diyan/pywinrm and get 
> results with no problem but my ansible ping results in 401.
>
> $ ansible windows -i inventory.yml -m win_ping -
>
> <192.168.2.3> ESTABLISH WINRM CONNECTION FOR USER: ansible on PORT 5986 TO 
> 192.168.2.3
>
> <192.168.2.3> WINRM CONNECT: transport=plaintext endpoint=
> https://192.168.2.3:5986/wsman
>
> <192.168.2.3> WINRM CONNECTION ERROR: 401 Unauthorized.
>
> 192.168.2.3 | FAILED => 401 Unauthorized. 
>
>

-- 
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/236d398c-bb70-4ecf-b46a-4273d6ebf93f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: Troubleshooting Windows Host UNREACHABLE!

2015-11-12 Thread Calhoun, Matt
I see a sucessful connection listed in the event logs, and in my original
post demonstrated that I could telnet in on the WinRM port, so no firewall
blocking. There is also no proxy or anything in between. I can connect to
over 100 different servers, many on the same subnet as myhost, but this is
the only one giving me trouble.

On Thu, Nov 12, 2015 at 1:19 PM, J Hawkesworth <
j.r.hawkeswo...@googlemail.com> wrote:

> try hitting it again with ansible and check the event logs for any
> evidence of a login attempt.
>
> if its not getting that far... is there a proxy between controller and
> windows host (guessing a bit here, not much experience with proxies)?
>
> possibly firewall rules kicking in?  bear in mind different profiles which
> may or may not be affecting connection from controller to windows target
> differently from windows to windows
>
> will try and think of more ideas.
>
>
> On Thursday, November 12, 2015 at 1:58:18 PM UTC, Matt Calhoun wrote:
>>
>> I have verified that PSRemoting seems to be working fine on this host.
>> From another windows box...
>>
>> PS C:\> Invoke-Command -ComputerName myhost -port 5985 -Authentication
>> Kerberos -ScriptBlock { Get-Content c:\windows\system32\drivers\etc\hosts
>>  } -credential myaccount
>> 
>>
>> # Copyright (c) 1993-2009 Microsoft Corp.
>> #
>> # This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
>> #
>> # This file contains the mappings of IP addresses to host names. Each
>> # entry should be kept on an individual line. The IP address should
>> # be placed in the first column followed by the corresponding host name.
>> # The IP address and the host name should be separated by at least one
>> # space.
>> #
>> # Additionally, comments (such as these) may be inserted on individual
>> # lines or following the machine name denoted by a '#' symbol.
>> #
>> # For example:
>> #
>> #  102.54.94.97 rhino.acme.com  # source server
>> #   38.25.63.10 x.acme.com  # x client host
>>
>> # localhost name resolution is handled within DNS itself.
>> #   127.0.0.1   localhost
>> #   ::1 localhost
>>
>>
>> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Ansible Project" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/ansible-project/ZebLwqaxYpo/unsubscribe.
> To unsubscribe from this group and all its topics, 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/0433d886-3b8b-413a-ae39-3c0f1c2b65a3%40googlegroups.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAEw3D2c6SZkGcvCE5APFS_vOhSmKNLbEOW97-RtLHn35o07nmA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Troubleshooting Windows Host UNREACHABLE!

2015-11-12 Thread J Hawkesworth
try hitting it again with ansible and check the event logs for any evidence 
of a login attempt.

if its not getting that far... is there a proxy between controller and 
windows host (guessing a bit here, not much experience with proxies)?

possibly firewall rules kicking in?  bear in mind different profiles which 
may or may not be affecting connection from controller to windows target 
differently from windows to windows

will try and think of more ideas.

On Thursday, November 12, 2015 at 1:58:18 PM UTC, Matt Calhoun wrote:
>
> I have verified that PSRemoting seems to be working fine on this host. 
> From another windows box...
>
> PS C:\> Invoke-Command -ComputerName myhost -port 5985 -Authentication 
> Kerberos -ScriptBlock { Get-Content c:\windows\system32\drivers\etc\hosts 
>  } -credential myaccount
> 
>
> # Copyright (c) 1993-2009 Microsoft Corp.
> #
> # This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
> #
> # This file contains the mappings of IP addresses to host names. Each
> # entry should be kept on an individual line. The IP address should
> # be placed in the first column followed by the corresponding host name.
> # The IP address and the host name should be separated by at least one
> # space.
> #
> # Additionally, comments (such as these) may be inserted on individual
> # lines or following the machine name denoted by a '#' symbol.
> #
> # For example:
> #
> #  102.54.94.97 rhino.acme.com  # source server
> #   38.25.63.10 x.acme.com  # x client host
>
> # localhost name resolution is handled within DNS itself.
> #   127.0.0.1   localhost
> #   ::1 localhost
>
>
>

-- 
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/0433d886-3b8b-413a-ae39-3c0f1c2b65a3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] lining up users when bootstrapping a system

2015-11-12 Thread Greg Swift
I've been bashing at this since yesterday and have read around a lot and
tried lots of things.  I figured it was time to try the list.

Basically I'm trying to create a playbook that will be used when
bootstrapping a fresh host.  The root user is needed for the initial
bootstrap.  After the on target steps, several other systems have to have
an action run on them authorizing the bootstrapped host, one of which is
puppet.  Here is are some examples of what I tried.

---
- hosts: boxens
  user: root
  tasks:
- yum: name={{ item }} state=present
  with_items: packages
- command: "puppet agent --noop --server={{ puppetmaster }}"
- command: "puppet cert sign {{ ansible_fqdn }}"
  delegate_to: "{{ puppetmaster }}"

This fails because the auth to the puppetmaster would be using my standard
network credentials, not the pre-bootstrap root user.

So I tried simply breaking this into multiple plays
---
- hosts: boxens
  user: root
  tasks:
- yum: name={{ item }} state=present
  with_items: packages
- command: "puppet agent --noop --server={{ puppetmaster }}"

- hosts: boxens
  tasks:
- command: "puppet cert sign {{ ansible_fqdn }}"
  delegate_to: "{{ puppetmaster }}"

Which fails because puppet hasnt actually run puppet, because it's cert
isnt signed, and so gather_facts doesn't work because it cant contact
newboxen using my regular credentials.

So... loop through the group?

---
- hosts: boxens
  user: root
  tasks:
- yum: name={{ item }} state=present
  with_items: packages
- command: "puppet agent --noop --server={{ puppetmaster }}"

- hosts: puppetmaster
  gather_facts: no
  tasks:
- command: "puppet cert sign {{ item }}"
  with_items: groups.boxens

Up until this step I've been running the task with a restricted host file
that only contained the new boxes.  Since my puppetmaster would be in our
normal inventory files expanding the input to this quickly makes
groups.boxens pretty much every box... most of which are already signed.  I
can do a 'creates' check against that, but it is still gonna try every one.

I've tried several other things, but all with more jank and less success
than the above. It seems like I'm missing something fairly obvious, but no
idea what.  Any suggestions?

thanks in advance

greg

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


[ansible-project] Re: gce instance start and stop existing instances (not create and destroy)

2015-11-12 Thread Richard Corfield
I have been trying to determine this myself and I have not successfully 
started a terminated instance with the Ansible gce module.

The titles of the Ansible module pages do seem to imply that the EC2 has a 
higher level of functionality than the GCE module:

ec2 - create, terminate, start or stop an instance in ec2 

gce - create or terminate GCE instances 


Richard


On Monday, 14 September 2015 15:56:21 UTC+1, Tongqing Qiu wrote:
>
> GCE now provides the function to stop and start the instances. Does 
> ansible gce module provides that function?
> I am not sure the meaning of  "active, present, absent, delete"  in the 
> following document. 
> http://docs.ansible.com/ansible/gce_module.html
>
>
>
-- 


Follow us on:     
  



Appsbroker Consulting Limited, Registered office: Appsbroker House, The 
Square, Swindon,
SN1 3EB, Company Number: 5702796, VAT Number: GB 876 3533 92, Company 
registered in England and Wales.

PLEASE NOTE AS RECIPIENT OF THIS EMAIL: Any views or opinions presented are 
solely those of the author and do not represent those of Appsbroker 
Consulting Limited. This e-mail is confidential and intended solely for the 
addressee. If you are not the intended recipient, be advised that you have 
received this mail in error and that any use, dissemination, forwarding, 
printing or copying of this e-mail is strictly prohibited. Furthermore, if 
you are not the intended recipient, please email it back to the sender and 
then immediately permanently delete 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/bdcb94f2-42eb-4703-a698-49ddebb1b5df%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] template with groups as a variable

2015-11-12 Thread Brian Coca
  - debug: msg="hey {{ item }}"
with_items: "{{groups[group_name]}}"

On Thu, Nov 12, 2015 at 5:44 AM, Edgardo Vega  wrote:
> Thanks Matt! is there way to do this in a playbook. The first one works the
> second one doesn't.
>
>   - debug: msg="hey {{ item }}"
> with_items: groups['tag_env_prod']
>
>   - debug: msg="hey {{ item }}"
> with_items: groups['{{group_name}}']
>
> On Thursday, November 12, 2015 at 7:59:20 AM UTC-5, Matt Martz wrote:
>>
>> You can't nest jinja2 delimiters.  You just use bare variable names inside
>> such as:
>>
>> {% for host in groups[VAR] %}
>>
>> On Thursday, November 12, 2015, Edgardo Vega  wrote:
>>>
>>> I am trying to do the following where I index groups by a variable
>>> instead of hardcoding it. Is that possible somehow?
>>>
>>> {% for host in groups['{{VAR}}'] %}
>>>  STUFF
>>> {% endfor %}
>>>
>>>
>>> Thanks in advance,
>>>
>>> Edgardo
>>>
>>>
>>> --
>>> 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/1d72aea3-f95f-45dc-99c5-f60f07fb51a0%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/c970b09c-cb50-4cad-b9cc-44161b152009%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/CAJ5XC8n%3DXqb0bpsA%3DgyaC%3Dsi0mYA7FBB8qJZHr0Z-LdXtJaiUw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Restart clustered service node by node?

2015-11-12 Thread Brian Coca
you can have more than 1 play in a playbook

- name: play1
  hosts: ...
  tasks:
 - do most of the work

- na

On Thu, Nov 12, 2015 at 2:38 AM, Rafał Radecki  wrote:
> Thanks for the tip. Overall serial looks good but it is usable only at the
> 'play' level. In my case I have one play which uploads a template for config
> file and does many other actions to configure the mysql cluster. I cannot
> afford setting serial=1 for the whole play and as I see in
> http://stackoverflow.com/questions/26685544/rolling-restart-with-ansible-handlers
> it is not possible to use serial for specific tasks and/or handlers only.
>
> Are there any other options?
>
>
> On Tuesday, November 10, 2015 at 7:36:06 PM UTC+1, Brian Coca wrote:
>>
>> set `serial: 1` at the play level it will force the tasks to all run
>> for one host at a time, combine that with wait_for to test that the
>> mysql db is back up.
>>
>>
>> --
>> 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/f09ac374-158e-48e0-9a31-4b6afb8214a0%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/CAJ5XC8k1iueDa%2BoaELn70uQ7F8bYRoCkAzfTM-yKpJA0Jv7buA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] vmware vm migrate between datastores using ansible?

2015-11-12 Thread AnilD
Hi guys,

Looks like state=reconfigured in vsphere_guest module cannot be used for 
datastore migration for a vm.
Is there is away to migrate a virtual machine to a different datastore in 
the vcenter using 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/14527768-d092-4f4f-8801-b8b3d6133114%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] "unsupported parameter for module: validate_cert",

2015-11-12 Thread Dee Young
I am trying to get around the "Unable to validate server's certificate 
against available CA certs" error. I've tried using uri: url=site url 
validate_cert=no and I'm still getting the same error. Then I tried using 
get_url: url=site url validate_cert=no, and now I'm getting "unsupported 
parameter for module: validate_cert". Can anyone help me with this 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/2a97d6b2-8c6d-451e-9409-3b75b899c6d7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Recovering stdout and stderr from sudo commands in async mode

2015-11-12 Thread Jose Ángel De Bustos Pérez
Hi,

I have to run sudo commands in async mode and recover the stdout/stderr.

I have written a module to run sudo commands but I am not able to recover 
the stdout and stderr. All of this is done from a python script and in the 
json which is returned the file indicated in results_file is empty.

Any ideas/suggestions? 

I am new to ansible so maybe there is a better way to do that.

Best regards,

-- 
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/7259a76f-d43a-46a2-97cf-351465edec90%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Recovering sdout/stderr from sudo commands in async mode

2015-11-12 Thread Jose Ángel De Bustos Pérez
Hi,

I have to execute sudo commands in async mode and I need to recover stdout 
and stderr.

I have written a module to do that but I am not able to recover the stdout 
and stderr.

All of this is done using a python script and the file indicate in 
results_file is empty.

I am new with ansible and maybe the problem is that I not doing it in the 
right form.

Any ideas/suggestions?

Best regards,

-- 
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/9232032b-ae76-4e19-9f03-e54ca48f6e51%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Solaris and pfexec, not working?

2015-11-12 Thread Thomas Willert
Hi,
I am not able to get the "ping" modules working when using privilege 
escalation on Solaris 11.

I am using Ansible 1.9.4 from a CentOS 7.1 control machine:

$ ansible --version
ansible 1.9.4
  configured module search path = None
$ cat /etc/redhat-release
CentOS Linux release 7.1.1503 (Core)

Remote server 'server1' is Solaris 11.1:

-bash-4.1$ uname -a
SunOS dbservere4 5.11 11.1 sun4v sparc sun4v


On the remote server 'server1' the account used to establish the SSH 
connection with has 'pfexec' privilges to become 'root':

-bash-4.1$ pfexec id
uid=0(root) gid=0(root)



Can someone help me understand why this is not working?

$ ANSIBLE_BECOME=True ANSIBLE_BECOME_METHOD=pfexec ansible server1 -m ping
server1 | FAILED => Internal Error: this module does not support running 
commands via pfexec


Thanks,
Thomas

-- 
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/d77b688d-73f9-47a0-bb2f-cbbf9fdc2755%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: How to SUBSTRING a string from a variable like hostname_01.com:28569 ... get only the hostname part or the port ?

2015-11-12 Thread Eric Franckx
OK ... found the issue:
var=production.clients.default.hosts[0].split(':')

Works.

thanks again to Matt Martz for the tip some_var.split(':')[0]

On Thursday, 12 November 2015 14:13:16 UTC+1, Eric Franckx wrote:
>
> Hi,
>
> if I have a string/var  with hostname_01.com:28569, how can I use the 
> hostname part (hostname_01 and don"t use the :28569)  to be use in an 
> action ?
>
> Regards,
>
>
-- 


--

This email is sent on behalf of Northgate Information Solutions Limited and 
its associated companies ("Northgate") and is strictly confidential and 
intended solely for the addressee(s). 

If you are not the intended recipient of this email you must: (i) not 
disclose, copy or distribute its contents to any other person nor use its 
contents in any way or you may be acting unlawfully;  (ii) contact 
Northgate immediately on +44 (0)1442 232424 quoting the name of the sender 
and the addressee then delete it from your system.

Northgate has taken reasonable precautions to ensure that no viruses are 
contained in this email, but does not accept any responsibility once this 
email has been transmitted.  You should scan attachments (if any) for 
viruses.
--

-- 
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/cebca521-8505-429d-ab3a-ef1a58fd9ea5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: How to SUBSTRING a string from a variable like hostname_01.com:28569 ... get only the hostname part or the port ?

2015-11-12 Thread Eric Franckx
Still an issue .. sorry I start with Ansible:

I have a config file with following entries:
production:
  clients:
default:
  database: db1
  hosts:
- host1.com:29017

and so if I try on it :
  debug: msg={{ production.clients.default.hosts.split(':')[0]}}

I have the following error: fatal: [xx.com]: FAILED! => {"failed": 
true, "msg": "ERROR! 'list object' has no attribute 'split'"}

:-(





On Thursday, 12 November 2015 14:13:16 UTC+1, Eric Franckx wrote:
>
> Hi,
>
> if I have a string/var  with hostname_01.com:28569, how can I use the 
> hostname part (hostname_01 and don"t use the :28569)  to be use in an 
> action ?
>
> Regards,
>
>
-- 


--

This email is sent on behalf of Northgate Information Solutions Limited and 
its associated companies ("Northgate") and is strictly confidential and 
intended solely for the addressee(s). 

If you are not the intended recipient of this email you must: (i) not 
disclose, copy or distribute its contents to any other person nor use its 
contents in any way or you may be acting unlawfully;  (ii) contact 
Northgate immediately on +44 (0)1442 232424 quoting the name of the sender 
and the addressee then delete it from your system.

Northgate has taken reasonable precautions to ensure that no viruses are 
contained in this email, but does not accept any responsibility once this 
email has been transmitted.  You should scan attachments (if any) for 
viruses.
--

-- 
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/f6e344c5-d208-4534-bf54-5afbe0b2a747%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: How to SUBSTRING a string from a variable like hostname_01.com:28569 ... get only the hostname part or the port ?

2015-11-12 Thread Eric Franckx
Super, you are the man

Thank you very much 

On Thursday, 12 November 2015 14:13:16 UTC+1, Eric Franckx wrote:
>
> Hi,
>
> if I have a string/var  with hostname_01.com:28569, how can I use the 
> hostname part (hostname_01 and don"t use the :28569)  to be use in an 
> action ?
>
> Regards,
>
>
-- 


--

This email is sent on behalf of Northgate Information Solutions Limited and 
its associated companies ("Northgate") and is strictly confidential and 
intended solely for the addressee(s). 

If you are not the intended recipient of this email you must: (i) not 
disclose, copy or distribute its contents to any other person nor use its 
contents in any way or you may be acting unlawfully;  (ii) contact 
Northgate immediately on +44 (0)1442 232424 quoting the name of the sender 
and the addressee then delete it from your system.

Northgate has taken reasonable precautions to ensure that no viruses are 
contained in this email, but does not accept any responsibility once this 
email has been transmitted.  You should scan attachments (if any) for 
viruses.
--

-- 
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/9a40a860-9470-467c-9096-91f76fafb29c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] How to SUBSTRING a string from a variable like hostname_01.com:28569 ... get only the hostname part or the port ?

2015-11-12 Thread Matt Martz
There a few ways.  One way is to use .split()

Such as:

some_var.split(':')[0]

On Thursday, November 12, 2015, Eric Franckx  wrote:

> Is there a advance substr( var, ':', 0) ---> to get from the begin of the
> string the substring ?
>
> On Thursday, 12 November 2015 14:13:16 UTC+1, Eric Franckx wrote:
>>
>> Hi,
>>
>> if I have a string/var  with hostname_01.com:28569, how can I use the
>> hostname part (hostname_01 and don"t use the :28569)  to be use in an
>> action ?
>>
>> Regards,
>>
>>
> --
>
> This email is sent on behalf of Northgate Information Solutions Limited
> and its associated companies ("Northgate") and is strictly confidential and
> intended solely for the addressee(s).
>
> If you are not the intended recipient of this email you must: (i) not
> disclose, copy or distribute its contents to any other person nor use its
> contents in any way or you may be acting unlawfully;  (ii) contact
> Northgate immediately on +44 (0)1442 232424 quoting the name of the sender
> and the addressee then delete it from your system.
>
> Northgate has taken reasonable precautions to ensure that no viruses are
> contained in this email, but does not accept any responsibility once this
> email has been transmitted.  You should scan attachments (if any) for
> viruses.
> --
>
> --
> 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/873a3971-60f7-4dde-850e-bfdef0697800%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/CAD8N0v8_yoOVCESR5m76k2b7VaE2fEEBb8nc5emFmcpkzeGZCg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Problem with Conditional Imports

2015-11-12 Thread Thomas Willert
I havent managed to understand my problem but I have been able to use this 
workaround using the "include_vars" module instead:

---
- hosts: server1:server2

  tasks:

  - include_vars: "{{ item }}"
with_first_found:
  - "vars/{{ ansible_os_family }}{{ ansible_distribution_version }}.yml"
  - "vars/defaults.yml"

  - debug: msg={{ homeprefix }}


/ Thomas
>

-- 
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/d1927f37-0cf5-45ca-a7e5-e62b816b6577%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Troubleshooting Windows Host UNREACHABLE!

2015-11-12 Thread Matt Calhoun
I have verified that PSRemoting seems to be working fine on this host. From 
another windows box...

PS C:\> Invoke-Command -ComputerName myhost -port 5985 -Authentication 
Kerberos -ScriptBlock { Get-Content c:\windows\system32\drivers\etc\hosts 
 } -credential myaccount


# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
#  102.54.94.97 rhino.acme.com  # source server
#   38.25.63.10 x.acme.com  # x client host

# localhost name resolution is handled within DNS itself.
#   127.0.0.1   localhost
#   ::1 localhost


-- 
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/f50604a9-2383-439b-aa9b-22ab1291a6c2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] template with groups as a variable

2015-11-12 Thread Edgardo Vega
Thanks Matt! is there way to do this in a playbook. The first one works the 
second one doesn't.

  - debug: msg="hey {{ item }}"
with_items: groups['tag_env_prod']

  - debug: msg="hey {{ item }}"
with_items: groups['{{group_name}}']

On Thursday, November 12, 2015 at 7:59:20 AM UTC-5, Matt Martz wrote:
>
> You can't nest jinja2 delimiters.  You just use bare variable names inside 
> such 
> as:
>
> {% for host in groups[VAR] %}
>
> On Thursday, November 12, 2015, Edgardo Vega  > wrote:
>
>> I am trying to do the following where I index groups by a variable 
>> instead of hardcoding it. Is that possible somehow?
>>
>> {% for host in groups['{{VAR}}'] %}
>>  STUFF
>> {% endfor %}
>>
>>
>> Thanks in advance,
>>
>> Edgardo
>>
>>
>> -- 
>> 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/1d72aea3-f95f-45dc-99c5-f60f07fb51a0%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/c970b09c-cb50-4cad-b9cc-44161b152009%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] CloudFront Module for Ansible

2015-11-12 Thread K Cheng
Hi Mohammad,

I've submitted pull request 
https://github.com/ansible/ansible-modules-extras/pull/1223 if you are still 
after an Ansible cloudfront module. 

Regards 

Ķaren 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/72407aba-a8ab-4f71-b6eb-3c83ea48663a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: How to SUBSTRING a string from a variable like hostname_01.com:28569 ... get only the hostname part or the port ?

2015-11-12 Thread Eric Franckx
Is there a advance substr( var, ':', 0) ---> to get from the begin of the 
string the substring ?

On Thursday, 12 November 2015 14:13:16 UTC+1, Eric Franckx wrote:
>
> Hi,
>
> if I have a string/var  with hostname_01.com:28569, how can I use the 
> hostname part (hostname_01 and don"t use the :28569)  to be use in an 
> action ?
>
> Regards,
>
>
-- 


--

This email is sent on behalf of Northgate Information Solutions Limited and 
its associated companies ("Northgate") and is strictly confidential and 
intended solely for the addressee(s). 

If you are not the intended recipient of this email you must: (i) not 
disclose, copy or distribute its contents to any other person nor use its 
contents in any way or you may be acting unlawfully;  (ii) contact 
Northgate immediately on +44 (0)1442 232424 quoting the name of the sender 
and the addressee then delete it from your system.

Northgate has taken reasonable precautions to ensure that no viruses are 
contained in this email, but does not accept any responsibility once this 
email has been transmitted.  You should scan attachments (if any) for 
viruses.
--

-- 
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/873a3971-60f7-4dde-850e-bfdef0697800%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Sentinel - Redis : fatal: [pyxrrsap02.pyx.erp]: FAILED! => {"failed": true, "msg": "ERROR! 'list object' has no attribute 'cmd'"}

2015-11-12 Thread Eric Franckx
SOLVED:

Simple by using : [0][0] and [0][1] to get the correct value/parameters.

On Wednesday, 11 November 2015 16:48:09 UTC+1, Eric Franckx wrote:
>
> Hi,
> I try to connect to a list of Sentinel host to get the master redis host 
> and port.
>
>- name: "CONNECT SENTINEL" command: "redis-cli -h {{ item.allowed_host 
>}} -p {{ item.port }} SENTINEL get-master-addr-by-name redis-pex-01" 
>with_items: "{{ production.redis_params.sentinels }}" register: 
>status_sentinel ignore_errors: yes
>
> TASK [CONNECT SENTINEL] 
> 
> changed: [pyxrrsap02.pyx.erp] => (item={u'allowed_host': u'pyxrrsap01', 
> u'port': 17700}) => {"changed": true, "cmd": ["redis-cli", "-h", 
> "pyxrrsap01", "-p", "17700", "SENTINEL", "get-master-addr-by-name", 
> "redis-pex-01"], "delta": "0:00:00.016587", "end": "2015-11-11 
> 00:49:19.387801", "item": {"allowed_host": "pyxrrsap01", "port": 17700}, 
> "rc": 0, "start": "2015-11-11 00:49:19.371214", "stderr": "", "stdout": 
> "10.50.133.20\n6379", "stdout_lines": ["10.50.133.20", "6379"], "warnings": 
> []}
> changed: [pyxrrsap02.pyx.erp] => (item={u'allowed_host': u'pyxrrsap01', 
> u'port': 27700}) => {"changed": true, "cmd": ["redis-cli", "-h", 
> "pyxrrsap01", "-p", "27700", "SENTINEL", "get-master-addr-by-name", 
> "redis-pex-01"], "delta": "0:00:00.017153", "end": "2015-11-11 
> 00:49:19.998121", "item": {"allowed_host": "pyxrrsap01", "port": 27700}, 
> "rc": 0, "start": "2015-11-11 00:49:19.980968", "stderr": "", "stdout": 
> "10.50.133.20\n6379", "stdout_lines": ["10.50.133.20", "6379"], "warnings": 
> []}
>
> I try to display result f register value:
> - name: "DISPLAY SENTINEL VAR 1"
> debug: msg={{ status_sentinel }}
> ignore_errors: yes
>
> TASK [DISPLAY SENTINEL VAR 1] 
> **
> ok: [pyxrrsap02.pyx.erp] => {
> "changed": false,
> "msg": {
> "changed": true,
> "msg": "All items completed",
> "results": [
> {
> "_ansible_no_log": false,
> "changed": true,
> "cmd": [
> "redis-cli",
> "-h",
> "pyxrrsap01",
> "-p",
> "17700",
> "SENTINEL",
> "get-master-addr-by-name",
> "redis-pex-01"
> ],
> "delta": "0:00:00.016587",
> "end": "2015-11-11 00:49:19.387801",
> "invocation": {
> "module_args": {
> "_raw_params": "redis-cli -h pyxrrsap01 -p 17700 SENTINEL 
> get-master-addr-by-name redis-pex-01"
> },
> "module_name": "command"
> },
> "item": {
> "allowed_host": "pyxrrsap01",
> "port": 17700
> },
> "rc": 0,
> "start": "2015-11-11 00:49:19.371214",
> "stderr": "",
> "stdout": "10.50.133.20\n6379",
> "stdout_lines": [
> "10.50.133.20",
> "6379"
> ],
> "warnings": []
> },
> {
> "_ansible_no_log": false,
> "changed": true,
> "cmd": [
> "redis-cli",
> "-h",
> "pyxrrsap01",
> "-p",
> "27700",
> "SENTINEL",
> "get-master-addr-by-name",
> "redis-pex-01"
> ],
> "delta": "0:00:00.017153",
> "end": "2015-11-11 00:49:19.998121",
> "invocation": {
> "module_args": {
> "_raw_params": "redis-cli -h pyxrrsap01 -p 27700 SENTINEL 
> get-master-addr-by-name redis-pex-01"
> },
> "module_name": "command"
> },
> "item": {
> "allowed_host": "pyxrrsap01",
> "port": 27700
> },
> "rc": 0,
> "start": "2015-11-11 00:49:19.980968",
> "stderr": "",
> "stdout": "10.50.133.20\n6379",
> "stdout_lines": [
> "10.50.133.20",
> "6379"
> ],
> "warnings": []
> }
> ]
> }
> }
>
> But when it tries to parse to have detail it doesn't work:
> - name: "DISPLAY SENTINEL VAR 1 1"
> debug: msg={{ status_sentinel.results.cmd }}
> ignore_errors: yes
>
> - name: "DISPLAY SENTINEL VAR 1 2"
>   debug: msg={{ item.cmd }}
>   with_items: ${status_sentinel.results}
>   ignore_errors: yes
>
> TASK [DISPLAY SENTINEL VAR 1 1] 
> 
> fatal: [pyxrrsap02.pyx.erp]: FAILED! => {"failed": true, "msg": "ERROR! 
> 'list object' has no attribute 'cmd'"}
> ...ignoring
>
> TASK [DISPLAY SENTINEL VAR 1 2] 
> 
> fatal: [pyxrrsap02.pyx.erp]: FAILED! => {"failed": true, "msg": "ERROR! 
> 'unicode object' has no attribute 'cmd'"}
> ...ignoring
>
> or like this :
> - name: "DISPLAY SENTINEL VAR 2 1"
> debug: var={{ item }}
> with_items: ${status_sentinel.results}
> ignore_errors: yes
>
> doesn't work:
> TASK [DISPLAY SENTINEL VAR 2 1] 
> 
> ok: [pyxrrsap02.pyx.erp] => (item=${status_sentinel.results}) => {
> "${status_sentinel.results}": "VARIABLE IS NOT DEFINED!",
> "item": "${status_sentinel.results}"
>
> Any idea ?
>
> Regards,
>
> --
>
> This email is sent on behalf of Northgate Information Solutions Limited 
> and its associated companies ("Northgate") and is strictly confidential and 
> intended solely for the addressee(s). 
>
> If you are not the intended recipient of this email you must: (i) not 
> disclose, copy or distribute its contents to any other person nor use its 
> contents in any way or you may be acting unlawfully;  (ii) contact 
> Northgate immediately on +

[ansible-project] How to SUBSTRING a string from a variable like hostname_01.com:28569 ... get only the hostname part or the port ?

2015-11-12 Thread Eric Franckx
Hi,

if I have a string/var  with hostname_01.com:28569, how can I use the 
hostname part (hostname_01 and don"t use the :28569)  to be use in an 
action ?

Regards,


-- 


--

This email is sent on behalf of Northgate Information Solutions Limited and 
its associated companies ("Northgate") and is strictly confidential and 
intended solely for the addressee(s). 

If you are not the intended recipient of this email you must: (i) not 
disclose, copy or distribute its contents to any other person nor use its 
contents in any way or you may be acting unlawfully;  (ii) contact 
Northgate immediately on +44 (0)1442 232424 quoting the name of the sender 
and the addressee then delete it from your system.

Northgate has taken reasonable precautions to ensure that no viruses are 
contained in this email, but does not accept any responsibility once this 
email has been transmitted.  You should scan attachments (if any) for 
viruses.
--

-- 
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/7f1d5edd-6616-4ee5-8a0b-d1469928e5a3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: template with groups as a variable

2015-11-12 Thread Edgardo Vega
I figured it out. You can just do the following and it will work.

{% for host in groups[VAR] %}

On Thursday, November 12, 2015 at 7:50:18 AM UTC-5, Edgardo Vega wrote:
>
> I am trying to do the following where I index groups by a variable instead 
> of hardcoding it. Is that possible somehow?
>
> {% for host in groups['{{VAR}}'] %}
>  STUFF
> {% endfor %}
>
>
> Thanks in advance,
>
> Edgardo
>
>
>

-- 
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/60f9943c-89df-4f84-8023-9790a4611a73%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] template with groups as a variable

2015-11-12 Thread Matt Martz
You can't nest jinja2 delimiters.  You just use bare variable names inside such
as:

{% for host in groups[VAR] %}

On Thursday, November 12, 2015, Edgardo Vega  wrote:

> I am trying to do the following where I index groups by a variable instead
> of hardcoding it. Is that possible somehow?
>
> {% for host in groups['{{VAR}}'] %}
>  STUFF
> {% endfor %}
>
>
> Thanks in advance,
>
> Edgardo
>
>
> --
> 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/1d72aea3-f95f-45dc-99c5-f60f07fb51a0%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/CAD8N0v8eHhFpkYXVvy2Ly1BpKhh2Gtu%2BSigqmVV4C1nU-WK4VQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] template with groups as a variable

2015-11-12 Thread Edgardo Vega
I am trying to do the following where I index groups by a variable instead 
of hardcoding it. Is that possible somehow?

{% for host in groups['{{VAR}}'] %}
 STUFF
{% endfor %}


Thanks in advance,

Edgardo


-- 
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/1d72aea3-f95f-45dc-99c5-f60f07fb51a0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Playbook name/path in callback plugin

2015-11-12 Thread tinyzais
Is it possible to get playbook name and/or path from within callback plugin?

-- 
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/57fc1919-693e-46e6-9009-c6894ea6dec7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Build automation using ESXi, Ansible, Pysphere

2015-11-12 Thread Jason Hiatt
We do something similar with our builds. The last thing we do in the post 
section of our Kickstart script is make a web service call. The web service 
moves the VM to the correct network. 

> On Nov 12, 2015, at 04:34, Mihai Cristian Satmarean 
>  wrote:
> 
> Great Mark - *There is always a way* even if is the crazyest way :)
> I will investigate for now the wait for idea and ping the port or something.
> Thanks a lot!
> 
> joi, 12 noiembrie 2015, 10:27:35 UTC+1, Mark Phillips a scris:
>> 
>> Not a problem Mihai! *There is always a way*.
>> 
>> There are choices here, as per usual - you could always use 'wait_for'[1] in 
>> an Ansible play, or you could use a 'phone home' type solution - i.e. the 
>> newly provisioned virtual machine boots and the first thing it does is 'look 
>> for' a centralised Ansible point to tell it 'hello, I'm booted'.
>> 
>> This is an example I did with Amazon earlier this year of a phone home - 
>> https://github.com/phips/tiad_demo/blob/master/plays/new.yml#L31 The actual 
>> script, highlighted in that line, is here: 
>> https://github.com/phips/tiad_demo/blob/master/scripts/ec2_bootstrap.sh All 
>> it is doing is a curl back an Ansible Tower instance, which runs a given job 
>> against the newly booted machine.
>> 
>> Hope that helps.
>> 
>> [1] http://docs.ansible.com/ansible/wait_for_module.html
>> 
>>> On Thursday, 12 November 2015 08:11:44 UTC, Mihai Cristian Satmarean  wrote:
>>> Hi Mark,
>>> 
>>> I get your point. Sorry for not being very clear (I am working on that).
>>> I am using this already  based on what is out there, 
>>> what I only miss is a way from vSphere to tell back to Ansible that the VM 
>>> was rebooted.
>>> that would be the killer feature for now.
>>> Thanks!
>>> 
>>> miercuri, 11 noiembrie 2015, 18:18:29 UTC+1, Mark Phillips a scris:
 
 Hello Mihai,
 
 Well, it's two other products there that are in effect needing control of. 
 You need vSphere to interact with the Linux boot disc menu - so not easy, 
 really.
 
 See my earlier post in this thread - set up a network boot (PXE) and have 
 two menu items. Or, alternatively, use something like iPXE 
 (http://ipxe.org) to make a specific boot disc image which you 'insert' 
 into the VMware VM CDROM to boot.
 
 Cheers
 
> On Wednesday, 11 November 2015 16:58:00 UTC, Mihai Cristian Satmarean 
> wrote:
> Thanks Mark,
> We are already doing both, I thought that there is a module or an Ansible 
> trick that you can specify the boot parameter in the vsphere boot :) that 
> would be helpful.
> 
> 
> vineri, 6 noiembrie 2015, 18:33:56 UTC+1, Mark Phillips a scris:
>> 
>> If it's from a CD boot Mihai just hit 'tab' then put ks= as Michael 
>> suggested.
>> 
>> Otherwise, with PXE boot you can specify the option on the kernel line, 
>> like:
>> 
>> kernel -n img 
>> http://ks.internal/centos/7/os/x86_64/images/pxeboot/vmlinuz 
>> ks=http://ks.internal/bootstrap/ks/7.ks
>> 
>> 
>>> On Friday, 6 November 2015 16:19:23 UTC, Mihai Cristian Satmarean wrote:
>>> @Michael, thanks! This might be exactly what I am looking for in this 
>>> stage, but I cannot find an example of how to insert the arguments at 
>>> boot to point to the remote kickstart.
>>> 
>>> Mihai Satmarean
>>> 
>>> 
>>> miercuri, 7 ianuarie 2015, 18:10:38 UTC+1, Michael DeHaan a scris:
 
 If you don't want to bake in the ks.cfg (for instance, if you have 
 different install profiles coming off the same OS), supplying the 
 kernel argument ks=http://server.example.com/foo.ks also works.
 
 
 
> On Wed, Jan 7, 2015 at 11:28 AM, Earl Robinson  
> wrote:
> Parimal,
> 
> To use kickstart you first need to present a boot media which is 
> configured to pull the kickstart file
> See: 
> http://www.centos.org/docs/5/html/5.2/Installation_Guide/s1-kickstart2-howuse.html
> 
> You can use ansible to present the VM with such bootable media by 
> launching it in a VLAN with a PXE boot server which will present the 
> media, or by presenting the VM with a CD image with the kickstart 
> file built in.
> 
> I've gone the CD image route with ansible, you can specify a cd image 
> to boot like this:
> 
> vsphere_guest:
>   vm_hardware:
> vm_cdrom:
>   type: "iso"
>   iso_path: "DatastoreName/cd-image.iso"
> 
> Of course you need to give the vsphere_guest module all other 
> required arguments, but this is the simplest way I've found to 
> kiskstart a vm using ansible.
> 
> -earl
> 
> 
>> On Tue, Jan 6, 2015 at 4:07 AM, Patel Parimal  
>> wrote:
>> Hi,
>> I am newbi

Re: [ansible-project] loop over host group to create string

2015-11-12 Thread John Favorite
Great, glad it worked for you!

On Wed, Nov 11, 2015, 1:27 PM Roy  wrote:

> Thanks following works for me.
>
>
> zookeeper.connect={% for node in groups['eventstore-zookeeper-' ] %}{{
> node }}:2181{% if not loop.last %},{% endif %}{% endfor %}
>
> --
> 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/f3d4263e-02fc-469f-a0a7-bf9105a5003f%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAKsMCERbrf74%2Bh-ZgRy4tB9bUdLtCmAfKNmporu%3DamZM0D2cgw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Restart clustered service node by node?

2015-11-12 Thread Rafał Radecki
Thanks for the tip. Overall serial looks good but it is usable only at the 
'play' level. In my case I have one play which uploads a template for 
config file and does many other actions to configure the mysql cluster. I 
cannot afford setting serial=1 for the whole play and as I see 
in 
http://stackoverflow.com/questions/26685544/rolling-restart-with-ansible-handlers
 
it is not possible to use serial for specific tasks and/or handlers only.

Are there any other options?

On Tuesday, November 10, 2015 at 7:36:06 PM UTC+1, Brian Coca wrote:
>
> set `serial: 1` at the play level it will force the tasks to all run 
> for one host at a time, combine that with wait_for to test that the 
> mysql db is back up. 
>
>
> -- 
> 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/f09ac374-158e-48e0-9a31-4b6afb8214a0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Build automation using ESXi, Ansible, Pysphere

2015-11-12 Thread Mihai Cristian Satmarean
Great Mark - *There is always a way* even if is the crazyest way :)
I will investigate for now the wait for idea and ping the port or something.
Thanks a lot!

joi, 12 noiembrie 2015, 10:27:35 UTC+1, Mark Phillips a scris:
>
> Not a problem Mihai! *There is always a way*.
>
> There are choices here, as per usual - you could always use 'wait_for'[1] 
> in an Ansible play, or you could use a 'phone home' type solution - i.e. 
> the newly provisioned virtual machine boots and the first thing it does is 
> 'look for' a centralised Ansible point to tell it 'hello, I'm booted'.
>
> This is an example I did with Amazon earlier this year of a phone home - 
> https://github.com/phips/tiad_demo/blob/master/plays/new.yml#L31 The 
> actual script, highlighted in that line, is here: 
> https://github.com/phips/tiad_demo/blob/master/scripts/ec2_bootstrap.sh 
> All it is doing is a curl back an Ansible Tower instance, which runs a 
> given job against the newly booted machine.
>
> Hope that helps.
>
> [1] http://docs.ansible.com/ansible/wait_for_module.html
>
> On Thursday, 12 November 2015 08:11:44 UTC, Mihai Cristian Satmarean wrote:
>>
>> Hi Mark,
>>
>> I get your point. Sorry for not being very clear (I am working on that).
>> I am using this already  based on what is out there, 
>> what I only miss is a way from vSphere to tell back to Ansible that the 
>> VM was rebooted.
>> that would be the killer feature for now.
>> Thanks!
>>
>> miercuri, 11 noiembrie 2015, 18:18:29 UTC+1, Mark Phillips a scris:
>>>
>>> Hello Mihai,
>>>
>>> Well, it's two other products there that are in effect needing control 
>>> of. You need vSphere to interact with the Linux boot disc menu - so not 
>>> easy, really.
>>>
>>> See my earlier post in this thread - set up a network boot (PXE) and 
>>> have two menu items. Or, alternatively, use something like iPXE (
>>> http://ipxe.org) to make a specific boot disc image which you 'insert' 
>>> into the VMware VM CDROM to boot.
>>>
>>> Cheers
>>>
>>> On Wednesday, 11 November 2015 16:58:00 UTC, Mihai Cristian Satmarean 
>>> wrote:

 Thanks Mark,
 We are already doing both, I thought that there is a module or an 
 Ansible trick that you can specify the boot parameter in the vsphere boot 
 :) that would be helpful.


 vineri, 6 noiembrie 2015, 18:33:56 UTC+1, Mark Phillips a scris:
>
> If it's from a CD boot Mihai just hit 'tab' then put ks= as Michael 
> suggested.
>
> Otherwise, with PXE boot you can specify the option on the kernel 
> line, like:
>
> kernel -n img 
> http://ks.internal/centos/7/os/x86_64/images/pxeboot/vmlinuz ks=
> http://ks.internal/bootstrap/ks/7.ks
>
> On Friday, 6 November 2015 16:19:23 UTC, Mihai Cristian Satmarean 
> wrote:
>>
>> @Michael, thanks! This might be exactly what I am looking for in this 
>> stage, but I cannot find an example of how to insert the arguments at 
>> boot 
>> to point to the remote kickstart.
>>
>> Mihai Satmarean
>>
>> miercuri, 7 ianuarie 2015, 18:10:38 UTC+1, Michael DeHaan a scris:
>>>
>>> If you don't want to bake in the ks.cfg (for instance, if you have 
>>> different install profiles coming off the same OS), supplying the 
>>> kernel 
>>> argument ks=http://server.example.com/foo.ks also works.
>>>
>>>
>>>
>>> On Wed, Jan 7, 2015 at 11:28 AM, Earl Robinson  
>>> wrote:
>>>
 Parimal,

 To use kickstart you first need to present a boot media which is 
 configured to pull the kickstart file
 See: 
 http://www.centos.org/docs/5/html/5.2/Installation_Guide/s1-kickstart2-howuse.html

 You can use ansible to present the VM with such bootable media by 
 launching it in a VLAN with a PXE boot server which will present the 
 media, 
 or by presenting the VM with a CD image with the kickstart file built 
 in.

 I've gone the CD image route with ansible, you can specify a cd 
 image to boot like this:

 vsphere_guest:
   vm_hardware:
 vm_cdrom:
   type: "iso"
   iso_path: "DatastoreName/cd-image.iso"

 Of course you need to give the vsphere_guest module all other 
 required arguments, but this is the simplest way I've found to 
 kiskstart a 
 vm using ansible.

 -earl


 On Tue, Jan 6, 2015 at 4:07 AM, Patel Parimal >>> > wrote:

> Hi,
> I am newbie to Ansible. 
>
> I have gone through the online documentation and examples for 
> creating new VM on Ansible Docs - vsphere_guest (
> http://docs.ansible.com/vsphere_guest_module.html).
>
> I want to automate VM creation and OS installation process using 
> Ansible.
>
> Currently I have VMWa

Re: [ansible-project] Build automation using ESXi, Ansible, Pysphere

2015-11-12 Thread Mark Phillips
Not a problem Mihai! *There is always a way*.

There are choices here, as per usual - you could always use 'wait_for'[1] 
in an Ansible play, or you could use a 'phone home' type solution - i.e. 
the newly provisioned virtual machine boots and the first thing it does is 
'look for' a centralised Ansible point to tell it 'hello, I'm booted'.

This is an example I did with Amazon earlier this year of a phone home - 
https://github.com/phips/tiad_demo/blob/master/plays/new.yml#L31 The actual 
script, highlighted in that line, is 
here: https://github.com/phips/tiad_demo/blob/master/scripts/ec2_bootstrap.sh 
All it is doing is a curl back an Ansible Tower instance, which runs a 
given job against the newly booted machine.

Hope that helps.

[1] http://docs.ansible.com/ansible/wait_for_module.html

On Thursday, 12 November 2015 08:11:44 UTC, Mihai Cristian Satmarean wrote:
>
> Hi Mark,
>
> I get your point. Sorry for not being very clear (I am working on that).
> I am using this already  based on what is out there, 
> what I only miss is a way from vSphere to tell back to Ansible that the VM 
> was rebooted.
> that would be the killer feature for now.
> Thanks!
>
> miercuri, 11 noiembrie 2015, 18:18:29 UTC+1, Mark Phillips a scris:
>>
>> Hello Mihai,
>>
>> Well, it's two other products there that are in effect needing control 
>> of. You need vSphere to interact with the Linux boot disc menu - so not 
>> easy, really.
>>
>> See my earlier post in this thread - set up a network boot (PXE) and have 
>> two menu items. Or, alternatively, use something like iPXE (
>> http://ipxe.org) to make a specific boot disc image which you 'insert' 
>> into the VMware VM CDROM to boot.
>>
>> Cheers
>>
>> On Wednesday, 11 November 2015 16:58:00 UTC, Mihai Cristian Satmarean 
>> wrote:
>>>
>>> Thanks Mark,
>>> We are already doing both, I thought that there is a module or an 
>>> Ansible trick that you can specify the boot parameter in the vsphere boot 
>>> :) that would be helpful.
>>>
>>>
>>> vineri, 6 noiembrie 2015, 18:33:56 UTC+1, Mark Phillips a scris:

 If it's from a CD boot Mihai just hit 'tab' then put ks= as Michael 
 suggested.

 Otherwise, with PXE boot you can specify the option on the kernel line, 
 like:

 kernel -n img 
 http://ks.internal/centos/7/os/x86_64/images/pxeboot/vmlinuz ks=
 http://ks.internal/bootstrap/ks/7.ks

 On Friday, 6 November 2015 16:19:23 UTC, Mihai Cristian Satmarean wrote:
>
> @Michael, thanks! This might be exactly what I am looking for in this 
> stage, but I cannot find an example of how to insert the arguments at 
> boot 
> to point to the remote kickstart.
>
> Mihai Satmarean
>
> miercuri, 7 ianuarie 2015, 18:10:38 UTC+1, Michael DeHaan a scris:
>>
>> If you don't want to bake in the ks.cfg (for instance, if you have 
>> different install profiles coming off the same OS), supplying the kernel 
>> argument ks=http://server.example.com/foo.ks also works.
>>
>>
>>
>> On Wed, Jan 7, 2015 at 11:28 AM, Earl Robinson  
>> wrote:
>>
>>> Parimal,
>>>
>>> To use kickstart you first need to present a boot media which is 
>>> configured to pull the kickstart file
>>> See: 
>>> http://www.centos.org/docs/5/html/5.2/Installation_Guide/s1-kickstart2-howuse.html
>>>
>>> You can use ansible to present the VM with such bootable media by 
>>> launching it in a VLAN with a PXE boot server which will present the 
>>> media, 
>>> or by presenting the VM with a CD image with the kickstart file built 
>>> in.
>>>
>>> I've gone the CD image route with ansible, you can specify a cd 
>>> image to boot like this:
>>>
>>> vsphere_guest:
>>>   vm_hardware:
>>> vm_cdrom:
>>>   type: "iso"
>>>   iso_path: "DatastoreName/cd-image.iso"
>>>
>>> Of course you need to give the vsphere_guest module all other 
>>> required arguments, but this is the simplest way I've found to 
>>> kiskstart a 
>>> vm using ansible.
>>>
>>> -earl
>>>
>>>
>>> On Tue, Jan 6, 2015 at 4:07 AM, Patel Parimal  
>>> wrote:
>>>
 Hi,
 I am newbie to Ansible. 

 I have gone through the online documentation and examples for 
 creating new VM on Ansible Docs - vsphere_guest (
 http://docs.ansible.com/vsphere_guest_module.html).

 I want to automate VM creation and OS installation process using 
 Ansible.

 Currently I have VMWare ESXi available which doesn't support VM 
 cloning, so I need to create a new VM every time from scratch and 
 install 
 OS(RHEL 6) into it.

 Is there any way to provide kickstart file URL in Ansible Playbook 
 (for example, static HTTP URL like http://192.168.0.1/ks/ks.cfg) 
 so after newly built VM is powered on, OS will

Re: [ansible-project] Build automation using ESXi, Ansible, Pysphere

2015-11-12 Thread Mihai Cristian Satmarean
Hi Mark,

I get your point. Sorry for not being very clear (I am working on that).
I am using this already  based on what is out there, 
what I only miss is a way from vSphere to tell back to Ansible that the VM 
was rebooted.
that would be the killer feature for now.
Thanks!

miercuri, 11 noiembrie 2015, 18:18:29 UTC+1, Mark Phillips a scris:
>
> Hello Mihai,
>
> Well, it's two other products there that are in effect needing control of. 
> You need vSphere to interact with the Linux boot disc menu - so not easy, 
> really.
>
> See my earlier post in this thread - set up a network boot (PXE) and have 
> two menu items. Or, alternatively, use something like iPXE (
> http://ipxe.org) to make a specific boot disc image which you 'insert' 
> into the VMware VM CDROM to boot.
>
> Cheers
>
> On Wednesday, 11 November 2015 16:58:00 UTC, Mihai Cristian Satmarean 
> wrote:
>>
>> Thanks Mark,
>> We are already doing both, I thought that there is a module or an Ansible 
>> trick that you can specify the boot parameter in the vsphere boot :) that 
>> would be helpful.
>>
>>
>> vineri, 6 noiembrie 2015, 18:33:56 UTC+1, Mark Phillips a scris:
>>>
>>> If it's from a CD boot Mihai just hit 'tab' then put ks= as Michael 
>>> suggested.
>>>
>>> Otherwise, with PXE boot you can specify the option on the kernel line, 
>>> like:
>>>
>>> kernel -n img 
>>> http://ks.internal/centos/7/os/x86_64/images/pxeboot/vmlinuz ks=
>>> http://ks.internal/bootstrap/ks/7.ks
>>>
>>> On Friday, 6 November 2015 16:19:23 UTC, Mihai Cristian Satmarean wrote:

 @Michael, thanks! This might be exactly what I am looking for in this 
 stage, but I cannot find an example of how to insert the arguments at boot 
 to point to the remote kickstart.

 Mihai Satmarean

 miercuri, 7 ianuarie 2015, 18:10:38 UTC+1, Michael DeHaan a scris:
>
> If you don't want to bake in the ks.cfg (for instance, if you have 
> different install profiles coming off the same OS), supplying the kernel 
> argument ks=http://server.example.com/foo.ks also works.
>
>
>
> On Wed, Jan 7, 2015 at 11:28 AM, Earl Robinson  
> wrote:
>
>> Parimal,
>>
>> To use kickstart you first need to present a boot media which is 
>> configured to pull the kickstart file
>> See: 
>> http://www.centos.org/docs/5/html/5.2/Installation_Guide/s1-kickstart2-howuse.html
>>
>> You can use ansible to present the VM with such bootable media by 
>> launching it in a VLAN with a PXE boot server which will present the 
>> media, 
>> or by presenting the VM with a CD image with the kickstart file built in.
>>
>> I've gone the CD image route with ansible, you can specify a cd image 
>> to boot like this:
>>
>> vsphere_guest:
>>   vm_hardware:
>> vm_cdrom:
>>   type: "iso"
>>   iso_path: "DatastoreName/cd-image.iso"
>>
>> Of course you need to give the vsphere_guest module all other 
>> required arguments, but this is the simplest way I've found to kiskstart 
>> a 
>> vm using ansible.
>>
>> -earl
>>
>>
>> On Tue, Jan 6, 2015 at 4:07 AM, Patel Parimal  
>> wrote:
>>
>>> Hi,
>>> I am newbie to Ansible. 
>>>
>>> I have gone through the online documentation and examples for 
>>> creating new VM on Ansible Docs - vsphere_guest (
>>> http://docs.ansible.com/vsphere_guest_module.html).
>>>
>>> I want to automate VM creation and OS installation process using 
>>> Ansible.
>>>
>>> Currently I have VMWare ESXi available which doesn't support VM 
>>> cloning, so I need to create a new VM every time from scratch and 
>>> install 
>>> OS(RHEL 6) into it.
>>>
>>> Is there any way to provide kickstart file URL in Ansible Playbook 
>>> (for example, static HTTP URL like http://192.168.0.1/ks/ks.cfg) so 
>>> after newly built VM is powered on, OS will be installed into it ?
>>>
>>> Thanks and regards,
>>> Parimal
>>>
>>> -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "Ansible Project" group.
>>> To unsubscribe from this group and stop receiving emails from it, 
>>> send an email to ansible-proje...@googlegroups.com.
>>> To post to this group, send email to ansible...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/ansible-project/da56aeef-01f0-41f6-8dc9-3cd1bdd138d5%40googlegroups.com
>>>  
>>> 
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> -- 
>> You received this message because you are subscribed to the Google 
>> Groups "Ansible Project" group.
>> To unsubscribe from this group and stop receiving