Re: [ansible-project] 1 big repo OR separate repo per app/group?

2016-02-11 Thread Michel Blanc


Le 10/02/2016 21:44, Guy Matz a écrit :


Does anyone have an opinion as to whether it's better to keep all
ansible code in one repo, or whether it's better to keep separate repos
for each group/app/arbitrary distinction?  I can see the benefits and
pitfalls of both, but can't tell which outweighs the other.

Any thoughts are greatly appreciated.


Hi Guy,

I've probably tried a broad spectrum on this topic, from a huge playbook 
covering all my systems, to something very fine grained. I now lie in 
the middle.


My first approach few years ago was to try to encompass all my needs in 
one playbook . I didn't even have roles (it was more a side feature at 
that time). The result was, of course, something completely unusable: 
side effects were numerous, things were failing all the time, and 
configuration drift started to cripple in. So, in the end, whatever you 
choose do, please just don't do this. You wont manage everything in one 
playbook and one inventory (unless you have a small, i.e.. 
"project-size", infrastructure). It will just grow to a monster that 
will eat you.


Now, assuming you have dedicated systems per project, I (currently) 
think the right size is the project size.


- one repo per role
- one repo containing playbooks & inventories (you might have several 
inventories e.g. dev, prod, ...)

- each required role as a submodule in playbook's roles/
- one ansible.cfg to point to the proper inventory (dev by default, to 
limit production accidents)


Having roles as submodules in playbook will let you improve roles 
without impacting other projects.


I usually split my playbooks per topic (baseline install, daemons, 
application, ...) but I try to limit splitting as it complicates things 
(variable, facts & handlers scoping). I use tags when I can but they 
come with the same limitations, although fact caching (I use Redis) 
helps a bit.


I also try to list each role explicitely in my playbooks, and try not to 
rely on dependency magic (and I don't use Galaxy).
Listing dependencies explicitely helps tracking down problems, and makes 
playbooks much more readable. Generally speaking, role coupling is your 
worst enemy.


I am pretty happy with this setup right now, but in the end, it is very 
dependent on your environment and style.


M
--
Michel Blanc
{ :github => "@leucos", :twitter => "@b9m", :gpg => "0X24B35C22" }

--
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/56BC41CC.4090802%40mbnet.fr.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] ERROR! privilege output closed while waiting for password prompt: BECOME-SUCCESS

2016-02-11 Thread Mark Maas


Hi All,

The following playbook worked fine with Ansible 1.9.4, but is breaking in 
2.0.0.2:

1.9.4 version:

---

- hosts:
  - all
  gather_facts: True

- name: Do local stuff
  hosts: 127.0.0.1
  connection: local
  tasks:
  - name: Add dev environment to hostsfile
sudo: true
lineinfile:
  dest: "/etc/hosts"
  regexp: "{{ item }}"
  line: "{{ hostvars[item]['ansible_default_ipv4']['address'] }} {{ item }}"
with_items: groups.all

  - name: Remove existing hostkey
shell: "ssh-keygen -R {{ item }}"
with_items: groups.all

  - name: Add new host key
shell: "ssh-keyscan {{ item }} >> ~/.ssh/known_hosts"
with_items: groups.all

and this is the 2.0.0.2 version:

---

- hosts: all
  gather_facts: True
  tasks:
  - name: setup
setup:

- name: Do local stuff
  hosts: localhost
  connection: local
  tasks:
  - name: Add dev environment to hostsfile
lineinfile:
  dest: "/etc/hosts"
  regexp: "{{ item }}"
  line: "{{ hostvars[item]['ansible_default_ipv4']['address'] }} {{ item }}"
with_items: groups.all
become: true
delegate_to: localhost

  - name: Remove existing hostkey
shell: "ssh-keygen -R {{ item }}"
with_items: groups.all

  - name: Add new host key
shell: "ssh-keyscan {{ item }} >> ~/.ssh/known_hosts"
with_items: groups.all

But when we run this:

TASK [Add dev environment to hostsfile] 
task path: 
/home/mark/Documents/persgroep/provisioning/test/update_host_file.yml:13
ESTABLISH LOCAL CONNECTION FOR USER: mark
localhost EXEC ( umask 22 && mkdir -p "$( echo 
$HOME/.ansible/tmp/ansible-tmp-1455181192.78-70674952507744 )" && echo "$( echo 
$HOME/.ansible/tmp/ansible-tmp-1455181192.78-70674952507744 )" )
localhost PUT /tmp/tmpELrS4d TO 
/home/mark/.ansible/tmp/ansible-tmp-1455181192.78-70674952507744/lineinfile
localhost EXEC /bin/sh -c 'sudo -H -S  -p "[sudo via ansible, 
key=afiilhlujllfoqvhmyqhfxivjsbaqdbp] password: " -u root /bin/sh -c '"'"'echo 
BECOME-SUCCESS-afiilhlujllfoqvhmyqhfxivjsbaqdbp; LANG=en_US.UTF-8 
LC_ALL=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 /home/mark/Envs/persgroep/bin/python 
/home/mark/.ansible/tmp/ansible-tmp-1455181192.78-70674952507744/lineinfile; rm 
-rf "/home/mark/.ansible/tmp/ansible-tmp-1455181192.78-70674952507744/" > 
/dev/null 2>&1'"'"''
localhost EXEC ( umask 22 && mkdir -p "$( echo 
$HOME/.ansible/tmp/ansible-tmp-1455181193.73-10161341089142 )" && echo "$( echo 
$HOME/.ansible/tmp/ansible-tmp-1455181193.73-10161341089142 )" )
localhost PUT /tmp/tmpF8fuw4 TO 
/home/mark/.ansible/tmp/ansible-tmp-1455181193.73-10161341089142/lineinfile
localhost EXEC /bin/sh -c 'sudo -H -S  -p "[sudo via ansible, 
key=feteajroilmicneyttrpeownjlnwlkgd] password: " -u root /bin/sh -c '"'"'echo 
BECOME-SUCCESS-feteajroilmicneyttrpeownjlnwlkgd; LANG=en_US.UTF-8 
LC_ALL=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 /home/mark/Envs/persgroep/bin/python 
/home/mark/.ansible/tmp/ansible-tmp-1455181193.73-10161341089142/lineinfile; rm 
-rf "/home/mark/.ansible/tmp/ansible-tmp-1455181193.73-10161341089142/" > 
/dev/null 2>&1'"'"''

fatal: [localhost]: FAILED! => {"failed": true, "msg": "ERROR! privilege output 
closed while waiting for password 
prompt:\nBECOME-SUCCESS-feteajroilmicneyttrpeownjlnwlkgd\n{\"msg\": \"\", 
\"invocation\": {\"module_args\": {\"directory_mode\": null, \"force\": null, 
\"remote_src\": null, \"backrefs\": false, \"insertafter\": null, \"owner\": 
null, \"follow\": false, \"line\": \"172.17.0.156 test-percona-02\", \"group\": 
null, \"insertbefore\": null, \"create\": false, \"setype\": null, \"content\": 
null, \"serole\": null, \"state\": \"present\", \"dest\": \"/etc/hosts\", 
\"selevel\": null, \"regexp\": \"test-percona-02\", \"validate\": null, 
\"src\": null, \"seuser\": null, \"delimiter\": null, \"mode\": null, 
\"backup\": false}}, \"changed\": false, \"backup\": \"\"}\n"}

I was thinking that using connection: local somehow interfered with become: 
true But I installed openssh-server and tried it via normal ssh means and 
still didn’t work.

I tried things with become: root, delegate_to, changing things in 
inventory, nothing seems to work. I’d love any suggestion?

Thanks!
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/3b268968-991a-4e4c-8895-3f08fcda5823%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: galaxy vs. Ubuntu 15.10

2016-02-11 Thread nusenu


Chris Houseknecht:
> Task runner infrastructure upgraded. Hopefully we'll see better 
> performance. 

thanks.

> Added Ubuntu Wily. 

Does one has to use the codename?  "15.10" does not seem to work still.

-- 
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/56BC4DFE.9030701%40openmailbox.org.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: OpenPGP digital signature


[ansible-project] Re: wait_for a windows file

2016-02-11 Thread 'J Hawkesworth' via Ansible Project
Hmm wait_for is a python module.

waiting for the port will work fine as that will presumably be happening on 
the ansible controller, rather than remotely on the machine you are trying 
to access.

If only waiting for a file will do then you could try using the fetch 
module to pull the file back you want to collect (fetch runs against 
windows hosts), then examine the file on the ansible controller.
Would likely need to be  wrapped in a block / rescue / always block - 
see http://docs.ansible.com/ansible/playbooks_blocks.html, and you might 
need to start off by waiting for a certain amount of time to avoid having 
to have multiple blocks to retry, but it might be enough to get you going.

Hope this helps,

Jon




On Wednesday, 10 February 2016 16:35:04 UTC, Stavros wrote:
>
> Hi,
>
> I use the wait_for in a playbook in order to wait until a file is present, 
> but this doesn't work, e.g.
>
>  - name: Wait for remote host
>wait_for: host={{ floating_ip }} path="C:\\Temp\\status.txt" 
> state=present
>
> When I use the wait_for module for the winrm port, then it works fine:
>
>  - name: Wait for remote host
>wait_for: host={{ floating_ip }} port=5986 state=started
>
>
> Any idea, how to wait in Windows for a file until it is present?
>
>
> Thanks in advance!
>
> KR,
> Stavros
>
>
>

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


[ansible-project] Re: Running NSSM from copied executables on windows and avoid installing NSSM

2016-02-11 Thread Joe Levis
Ishan,

The raw module works pretty much the same on Windows as it does on Linux - 
anything you can run on the command line can be run using the raw module. 
So, if you are wanting to use this nssm.exe rather than actually installing 
nssm, you would simply specify the path to the executable and pass whatever 
arguments it enables.

I haven't found a way to specify the AppDirectory upon creation of the 
service, so what I do is run the raw module to set that *after* the service 
has been created. For you, this might look something like this:

raw: C:\path\to\nssm.exe set [ServiceName] AppDirectory 
C:\path\to\appdirectory


Hope this helps.


-Joe

On Thursday, February 11, 2016 at 6:47:42 AM UTC-8, ishan jain wrote:
>
> Hi,
>
> I am trying to create some services on my windows machines with the help 
> of NSSM and would like to automate the process with Ansible. NSSM module 
> for ansible requires NSSM to be installed on the windows machine but i 
> cannot do that as internet is disabled on my windows machine. I want to use 
> the nssm.exe that i have copied on the remote server.
>
> How can i tell ansible to use those copied executables to run NSSM ? I 
> really need to specify the ApplicationDir, so i guess the ansible module is 
> not going to be useful for me.
>
> I think this problem will be solved via the raw module but honestly i do 
> not understand it much. Maybe because there is no proper documentation of 
> raw module for windows.
>

-- 
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/c2c632ec-0fd3-471f-91e0-3a997afb51cc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] 389 server stops after Ansible "hangs up"

2016-02-11 Thread Brian Coca
command/shell are not good ways of starting services, setup a init
script/system|upstart configuration instead.

But "if you must", add `nohup` to the command as Ansible immediately
terminates the tty and the 'daemon' might not have detached yet or detach
correctly which can stall/kill the process.

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


[ansible-project] Re: Can not attach CM rom in Vmware

2016-02-11 Thread Asaf Moalem
Hi,
Were you able to connect the cdrom? 
I get the cdrom mounted with the ISO, but not connected.

Thanks.
Asaf.


On Friday, October 16, 2015 at 7:12:32 PM UTC+3, Nick Vanadium wrote:
>
> Greetings all. Apologies if this is not the correct place to post this but 
> I wasn't able to find anything related to this. 
>
> So I have recently began playing with Ansible and I am trying to build 
> some VMs in Vmware Sphere using the Ansible module. However I can't seem to 
> be able to attach the CD rom to the VM with VMware. Below is the error I 
> receive along with the syntax of my playbook. Any assistance would be much 
> appreciated. 
>
> *My error:*
>
> PLAY [all] 
> 
>
> TASK: [vsphere_guest ] 
> 
> failed: [EXAMPLE-Web01] => {"failed": true}
> msg: unsupported parameter for module: vm_cdrom
>
> FATAL: all hosts have already failed -- aborting
>
> PLAY RECAP 
> 
>to retry, use: --limit @/home/ansible/create_vm.retry
>
> EXAMPLE-Web01  : ok=0changed=0unreachable=0failed=1
>
>
> --
> *My playbook*:
>
> - hosts: all
>   gather_facts: false
>   connection: local
>   user: ansible
>   sudo: true
>
>   vars_prompt:
> - name: "vcenter_hostname"
>   prompt: "Enter vcenter hostname"
>   private: no
>   default: "vsphere.mydomain.com"
> - name: "vcenter_user"
>   prompt: "Enter vcenter username"
>   private: no
> - name: "vcenter_pass"
>   prompt: "Enter vcenter password"
>   private: yes
>
>   vars:
> datacenter: 'My-Datacenter'
> esxi_host: 'esx1.mydomain.com'
> notes: 'Created by Ansible'
>   tasks:
> - vsphere_guest:
> vcenter_hostname: "{{ vcenter_hostname }}"
> username: "{{ vcenter_user }}"
> password: "{{ vcenter_pass }}"
> guest: "{{ inventory_hostname }}"
> state: powered_on
> vm_extra_config:
>   notes: "{{ notes }}"
> vm_disk:
>   disk1:
> size_gb: "{{ disk }}"
> type: thick
> datastore: "{{ datastore }}"
> # Attach CD ROM to VM
> vm_cdrom:
> type: "iso"
> iso_path: "datastore1/iso/ansible-ks.iso"
> vm_nic:
>   nic1:
> type: vmxnet3
> network: "{{ network }}"
> network_type: standard
> vm_hardware:
>   memory_mb: "{{ memory }}"
>   num_cpus: "{{ cpucount }}"
>   osid: "{{ osid }}"
>   scsi: paravirtual  
> esxi:
>   datacenter: "{{ datacenter }}"
>   hostname: "{{ esxi_host }}"
> 
>
>
>
>
> *Hosts definedEXAMPLE-Web01 disk='8' datastore='datastore1' 
> network='vlan1' memory='512' cpucount='2' osid='rhel6_64Guest'*
>

-- 
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/b6902f1e-44c3-4acc-b6a1-d68bfdbd3ab0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] deploying ansible with ansible

2016-02-11 Thread Frederic Van Espen
Hi,

We have an existing architecture where one host manages a number of hosts. 
Any of these hosts could be managing a number of other hosts. So we have a 
tree like architecture.

  MASTER HOST
   |
  / \
/-   --\\
   /\\
HOST A HOST B  HOST C
  |
 / \
   /-   \
  /  \
  HOST D   HOST E

Hosts on one level can only directly access hosts on the level below that 
are managed by them. So the master host can access hosts A, B and C only. 
Host A can only access hosts D and E.

We are thinking now of using ansible to manage the tree of hosts but we'd 
like to keep the existing architecture where the master host can manage 
host A, B and C through ansible. Host A should in turn manage hosts D and E 
through ansible.

Can this be done? Can I deploy ansible with ansible? Is anyone elso doing 
something similar? I'm thinking of starting to use this for something 
simple like deploying ssh public keys in authorized_keys files.

Thanks for any feedback.

Frederic

-- 
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/f58cf43f-c57d-43ee-b779-9b4efcf43781%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Want EIP to move uncondtionally

2016-02-11 Thread Shaun Brady
Hello,
Previously I had a playbook that would create an instance and associate an
EIP
with it.  If this EIP was on another host, it would just be moved.  I now
get:

Resource.AlreadyAssociated
resource eipalloc-d26705b6 is already associated with associate-id
eipassoc-f7bf1d8f
693c1800-0a6d-4af4-9587-3f715fd8bd8c


I believe the change is moving from EC2-Classic to VPC.  If I just try use
ec2_eip to disassociate the address, I need to provide the instance id it is
currently associated with.  I don't see a straight forward way to look up
this
instance, as 1) I'm already in a play connected to a host, but more
importantly
2) I don't know if the host is up.

Is there a method I'm missing to say "disassociate this regardless of its
current status", or to easily look up the instance associated with the EIP?

For reference we are still on 1.9, but if the answer is in 2.0, that is in
our
future.

Thanks!

Shaun Brady
Senior Web Services Engineer
Nimbis Services, Inc.

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


[ansible-project] Running NSSM from copied executables on windows and avoid installing NSSM

2016-02-11 Thread ishan jain
Hi,

I am trying to create some services on my windows machines with the help of 
NSSM and would like to automate the process with Ansible. NSSM module for 
ansible requires NSSM to be installed on the windows machine but i cannot 
do that as internet is disabled on my windows machine. I want to use the 
nssm.exe that i have copied on the remote server.

How can i tell ansible to use those copied executables to run NSSM ? I 
really need to specify the ApplicationDir, so i guess the ansible module is 
not going to be useful for me.

I think this problem will be solved via the raw module but honestly i do 
not understand it much. Maybe because there is no proper documentation of 
raw module for windows.

-- 
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/8c69a1d4-6fb5-482b-b383-44ac4f7c132d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Copy/Template modules hang on AIX - sh.py

2016-02-11 Thread Mohamed Saffar
Thank you very very very much Matthew, we have the same problem on aix 
clients and it is a bloker issuer. I confirm that changing the ssh.py with 
-T option fixes the problem.

-- 
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/88b6861c-dc57-414d-a8ec-e1a99e76adf7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Proper way to handle host data coming from multiple CSV files

2016-02-11 Thread Con Hennessy
Hi,
 I'm new to ansible and coming from a system where we have multiple CSV 
files defining
projects, hosts, and users which I cannot easily change.

If I want to run certain commands I need to gather info from several files. 

Is there is recommended way of doing this ?

I have been looking at the dynamic inventory, but I was hoping to us 
something better than
passing environment variables to the inventory.

(Actually I'm a python guy and I was hoping that the inventory module could 
be written in python
and actually called as a module internally by ansible rather than an 
executable script.)

Any direction or pointers would be appreciated,
Con

-- 
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/ee64e370-7cc0-4b9e-9d45-458864329532%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] How to make symbolic links in windows via Ansible ?

2016-02-11 Thread ishan jain
I am trying to make a lot symbolic links for my directories and files and 
manually i use mklink command to make them. Oddly enough, this command 
requires admin level privileges to create links. 

How can i use mklink via ansible with admin privileges to create symbolic 
links ?

-- 
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/ac7d68c6-70b6-426d-bdf2-0f841456b015%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Global hooks/tasks

2016-02-11 Thread Tobias Wolf
We had this discussion over lunch, i.e., we pondered how we could get 
ansible to trigger etckeeper on each host at the conclusion of the 
playbook. We excluded handlers because handlers are not executed once a 
playbook fails.

Did you find a way to cleanly create a hook like this with having to append 
this to each playbook individually?

--Tobias

On Thursday, November 5, 2015 at 4:40:32 PM UTC+1, Dominic Hargreaves wrote:
>
> Hi,
>
> I've had a look around for solutions to this problem, but surprisingly I'm 
> starting to think it's not something supported out of the box with ansible.
>
> I would like to define a play or series of plays which are called exactly 
> once on a given group of hosts for each ansible run, at the very start and 
> very end of that run, regardless of which role or roles are being executed. 
> Optionally, the set of tasks at the end could only run if any of the other 
> tasks run changed something (a sort of global_changed state), but this 
> isn't essential. Using ro
>
> The use-case is to run etckeeper before and after each run of ansible, to 
> provide a definitive record of what changed on the server (at least as far 
> as the configuration files in /etc go).
>
> Does anyone have any suggestions on how I might accomplish this? Would a 
> new feature request be appropriate if it's not already achievable? Note 
> that I wouldn't want to have to modify every playbook and/or role to 
> achieve this, since that would inevitably lead to missed commits and 
> default the point of having a complete changelog.
>
> Just in case it isn't obvious: yes, I am managing the ansible playbooks in 
> git already, but etckeeper provides a deeper view of what *actually* 
> changed on the server and can be very helpful for looking back to figure 
> out when/how something was misconfigured.
>
> I would be interested to hear other solutions to this.
>
> Cheers,
> Dominic.
>

-- 
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/1a612708-41a9-4ae1-8f8d-c5d2fa85ea19%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] When conditional bug in Ansible 2.0.0.2 ?

2016-02-11 Thread Brian Coca
The previous exception was ignored in this case, 2.0 does not ignore
exceptions, that is the main difference.

​This is not a deprecated feature, it was an unreported error.​

--
Brian Coca

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


Re: [ansible-project] When conditional bug in Ansible 2.0.0.2 ?

2016-02-11 Thread Brian Coca
see if this helps https://github.com/ansible/ansible/pull/14441


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


[ansible-project] Re: Help with setting ephemeral volume on EC2

2016-02-11 Thread Roy
What type of instance you are using, because not all instances comes with 
ephemeral

-- 
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/e850283a-e441-44f3-9d8a-71abc8d434a4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] How to Export Ansible Tower job logs

2016-02-11 Thread Matt Martz
For tower questions please contact supp...@ansible.com or
https://support.ansible.com

This list is for the open source Ansible project.

On Thursday, February 11, 2016,  wrote:

> Hi All,
>
> Can you please help me out to find a way to export Ansible tower job logs
> (Ex: Job number, Start time, End time etc)
> Thanks in advance.
>
> Regards
> Thomas Xavier
>
> --
> 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/24783ba4-870e-4f0c-8d31-cb61f69dbac9%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 
Matt Martz
@sivel
sivel.net

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


Re: [ansible-project] When conditional bug in Ansible 2.0.0.2 ?

2016-02-11 Thread Brian Coca
I'm not saying that it is not a problem, just that it is not as easy to
mark as 'deprecated' when there was no knob to 'turn off this feature' but
a general tightening on propagating and capturing errors.


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


[ansible-project] Ansible Contributor Summit

2016-02-11 Thread Robyn Bergeron
Greetings!

Ansible will be holding our first contributor summit on Wednesday, February
17th in London, the day before AnsibleFest.

The Ansible core team will be collaborating in person with some of the most
prolific members of the Ansible community, and the session will be
available to all via IRC and streaming media. Details about the schedule
and topics, along with where and when to participate, can be found here:

https://public.etherpad-mozilla.org/p/ansible-summit

We’ll be doing our best to document the in-person comments and
conversations on IRC, as well as streaming and recording the meeting, so
that folks can participate remotely or view the activity and output
afterwards.

And of course, when we’re done, we’ll be sure to let everyone know the
output of our day in a blog post or email.

Cheers,

-Robyn

-- 
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/CA%2BXMROhXT4uVcwD_CSnEg4WBWgt1huOsQO1uL-LL7-9cVEgQew%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] How to Export Ansible Tower job logs

2016-02-11 Thread Brian Coca
for tower use supp...@ansible.com or http://support.ansible.com


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


Re: [ansible-project] When conditional bug in Ansible 2.0.0.2 ?

2016-02-11 Thread Mark Maas
Understood, we can call it all kinds of things, but companies and/or teams
have been building playbooks with these things. They are now breaking.
One team I know is now using it as an excuse to start using puppet again as
"Ansible is still a moving target".

This isn't a rant. ... ...well maybe a litte ;-)   But it's also an
observation. Ansible really needs to be carefull with these sort of
changes. I don't want people to turn to other things because of things like
this.

On Thu, Feb 11, 2016 at 4:20 PM Brian Coca  wrote:

> The previous exception was ignored in this case, 2.0 does not ignore
> exceptions, that is the main difference.
>
> ​This is not a deprecated feature, it was an unreported error.​
>
> --
> Brian Coca
>
> --
> 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/2z3A7nGIfSw/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/CACVha7e8AvMvad9Fwq-grLusemANnFKhGBs-xC2-WZ8_Zv-sZA%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>
-- 
mark@debian:~$ cat ~/.signature
Mark Maas || Linux Engineer || DevOps

T: +31 6 215 924 05
Fastest way to my heart is via email

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


[ansible-project] How to mount all ephemeral ?

2016-02-11 Thread Roy
Hi,


 I was creating a playbook to spin up an EC2 instance and then mount all 
available ephemeral mount to /mnt/ephemeral0, /mnt/ephemeral1 ... etc.

First thing I want to do it activate all available ephemeral drive on 
specific instance in the playbook 
Then mount all drive to specific mount point.

I was looking at http://docs.ansible.com/ansible/ec2_module.html
for this task, but I didnt find. Am I looking at wrong module ?

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/0be3c430-7c62-4fa1-a788-3a9534d6f334%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Debian/Ubuntu: Show available updates (or control if all updates are installed)

2016-02-11 Thread Johannes Kastl
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi everyone,

is it possible to show all available updates on Debian/Ubuntu/...
via apt? Or rather, check if all updates have been installed without
errors?

Basically something like this (which does not work, I have not
tested why):

> ---
> 
> - name: refresh cache
>  apt: update_cache=yes
> 
> 
> - name: Show all available updates become: true shell: apt-get
> upgrade -u | mail -s "Available Updates on $(hostname -f)" root

Thanks in advance!

Johannes
-BEGIN PGP SIGNATURE-
Version: GnuPG v2
Comment: Using GnuPG with SeaMonkey - http://www.enigmail.net/

iEYEARECAAYFAla83KcACgkQzi3gQ/xETbIqcwCgklsEpGA0ozVe9UbVA4B5T9Qa
Sn4AniOhuEnc90YjfGyxAFbgqLPPKWDq
=id1c
-END PGP SIGNATURE-

-- 
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/56BCDCAC.8000503%40ojkastl.de.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: yum task fails in playbook

2016-02-11 Thread bryan . yu
Figured out the issue. I set some environmental variables (for Oracle 
sqlplus) in my playbook that caused conflicts with the yum module.

On Thursday, February 4, 2016 at 1:45:20 PM UTC-6, brya...@santecapital.com 
wrote:
>
> Ansible 2.0.0.2
>
> I can run the yum module via ansible ad-hoc command 
>
> ansible testloader -i inventory --vault-password-file ~/.vault_pass.txt -u 
> ec2-user -m yum -a "name=* state=latest"
>
> But when I run the module as a task inside the playbook I get module failed
>
> TASK [test] 
> 
> fatal: [54.175.222.151]: FAILED! => {"changed": false, "failed": true, 
> "module_stderr": "", "module_stdout": "Traceback (most recent call 
> last):\r\n  File 
> \"/home/ec2-user/.ansible/tmp/ansible-tmp-1454614620.72-202915244324385/yum\",
>  
> line 3767, in \r\nmain()\r\n  File 
> \"/home/ec2-user/.ansible/tmp/ansible-tmp-1454614620.72-202915244324385/yum\",
>  
> line 1025, in main\r\ndisablerepo, disable_gpg_check, exclude, 
> repoquery)\r\n  File 
> \"/home/ec2-user/.ansible/tmp/ansible-tmp-1454614620.72-202915244324385/yum\",
>  
> line 948, in ensure\r\nres = latest(module, pkgs, repoq, yum_basecmd, 
> conf_file, en_repos, dis_repos)\r\n  File 
> \"/home/ec2-user/.ansible/tmp/ansible-tmp-1454614620.72-202915244324385/yum\",
>  
> line 759, in latest\r\nrc, out, err = module.run_command(yum_basecmd + 
> ['check-update'])\r\n  File 
> \"/home/ec2-user/.ansible/tmp/ansible-tmp-1454614620.72-202915244324385/yum\",
>  
> line 2792, in run_command\r\nargs = [ 
> os.path.expandvars(os.path.expanduser(x)) for x in args ]\r\n  File 
> \"/usr/lib64/python2.7/posixpath.py\", line 254, in expanduser\r\nif 
> not path.startswith('~'):\r\nAttributeError: 'NoneType' object has no 
> attribute 'startswith'\r\n", "msg": "MODULE FAILURE", "parsed": false}
>
> I don't understand why this is happening as I have an identical task 
> within a different playbook (using a different set of group hosts), it 
> works. 
>

-- 
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/6335215d-cb52-4e9c-8e9c-f794c0ef32ed%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] How to Export Ansible Tower job logs

2016-02-11 Thread txavier
Hi All,

Can you please help me out to find a way to export Ansible tower job logs 
(Ex: Job number, Start time, End time etc)
Thanks in advance.

Regards
Thomas Xavier

-- 
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/24783ba4-870e-4f0c-8d31-cb61f69dbac9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Using ansible to call python script with subprocess module to run sqlplus script, Ansible shows missing sqlplus...?

2016-02-11 Thread bryan . yu
Environment variables needed to be set for sqlplus + ansible interaction

using shell module with executable /bin/bash and setting specific 
environment variables (without referencing other env vars) fixed this. If 
anyone else uses ansible with sqlplus, here's a better play for you

- name: Run python script
  shell: python script.py
chdir=dir/dir1/dir2
executable=/bin/bash
  register: script_result
  environment:
ORACLE_HOME: /usr/lib/oracle/11.2/client64
PATH: 
"/usr/lib/oracle/11.2/client64/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/opt/aws/bin:/home/ec2-user/.local/bin:/home/ec2-user/bin"
LD_LIBRARY_PATH: "/usr/lib/oracle/11.2/client64/lib"
  tags:
- script



On Thursday, February 11, 2016 at 1:04:47 PM UTC-6, 
brya...@santecapital.com wrote:
>
> Hello all,
>
> I am using ansible to deploy and provision some instances then runs a 
> python script at the very end. The python script uses the subprocess 
> module 
>  to 
> call a sql script and generate flat text files. When I directly ssh into 
> the instances and run remotely, everything works. However when I use 
> ansible to call the python script it looks like commands don't get passed 
> to the Popen construct OR sqlplus is not installed??? Which is weird cause 
> it definitely is installed. This may be a more python oriented question but 
> since I only have the issue when using Ansible to run the python program... 
> I'm posting here. 
>
> Ansible: 
> ansible webservers -i inventory --vault-password-file ~/.vault_pass.txt -u 
> ec2-user -m command -a "python script.py chdir=dir/dir1/dir2"
>
> Python:
> connect_string=username/password@connectionObject
> sql_command=@sql_script.sql
>
> def run_sql_query(sql_command, connect_string):
>   """
>   Run sqlCommand and return query result and error Message
>   """
>   session = Popen(['sqlplus', '-S', connect_string], stdin=PIPE, 
> stdout=PIPE, stderr=PIPE)
>   session.stdin.write(sql_command)
>   return session.communicate()
>
> Error:
>   File "/usr/lib64/python2.7/subprocess.py", line 710, in __init__
> errread, errwrite)
>   File "/usr/lib64/python2.7/subprocess.py", line 1335, in _execute_child
> raise child_exception
> OSError: [Errno 2] No such file or directory
>
> A closer look shows that one of the following is happening:
>
> 1) /bin/bash: sqlplus: command not found
>  
> HOW???
>

-- 
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/3d732caf-7f16-4e66-9297-5afd7a63e984%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Using ansible to call python script with subprocess module to run sqlplus script, Ansible shows missing sqlplus...?

2016-02-11 Thread bryan . yu
Hello all,

I am using ansible to deploy and provision some instances then runs a 
python script at the very end. The python script uses the subprocess module 
 to 
call a sql script and generate flat text files. When I directly ssh into 
the instances and run remotely, everything works. However when I use 
ansible to call the python script it looks like commands don't get passed 
to the Popen construct OR sqlplus is not installed??? Which is weird cause 
it definitely is installed. This may be a more python oriented question but 
since I only have the issue when using Ansible to run the python program... 
I'm posting here. 

Ansible: 
ansible webservers -i inventory --vault-password-file ~/.vault_pass.txt -u 
ec2-user -m command -a "python script.py chdir=dir/dir1/dir2"

Python:
connect_string=username/password@connectionObject
sql_command=@sql_script.sql

def run_sql_query(sql_command, connect_string):
  """
  Run sqlCommand and return query result and error Message
  """
  session = Popen(['sqlplus', '-S', connect_string], stdin=PIPE, 
stdout=PIPE, stderr=PIPE)
  session.stdin.write(sql_command)
  return session.communicate()

Error:
  File "/usr/lib64/python2.7/subprocess.py", line 710, in __init__
errread, errwrite)
  File "/usr/lib64/python2.7/subprocess.py", line 1335, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory

A closer look shows that one of the following is happening:

1) /bin/bash: sqlplus: command not found
 
HOW???

-- 
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/32c1644a-88ef-4f23-9aa2-578a378789ea%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: win_copy failing

2016-02-11 Thread 'J Hawkesworth' via Ansible Project
I don't think win_copy can collect from a share like you are trying to do 
in the example above.

The assumption is that the source file you are copying is on the ansible 
controller.

One trick you could use is to run smbclient on the ansible controller to 
collect the files you want to deploy to your windows clients first, then 
you can win_copy them across.

You might be able to use script to collect files from a share but you are 
likely to need to pass credentials to the script running on your windows 
machines (windows makes a distinction about whether or not you are logged 
in as an interactive user - if you are not, such as when you are using 
remoting - then different permissions apply and you may not have access to 
the remote share).

Hope this helps,

Jon


On Wednesday, 10 February 2016 15:34:41 UTC, Mark Matthews wrote:
>
> Im trying to find out if it is possible to copy a folder (with sub 
> folders) from one Windows server on the network to all Windows servers in 
> the playbook?
>
>
>
> On Wednesday, February 10, 2016 at 12:24:13 PM UTC, Mark Matthews wrote:
>>
>> Hi
>>
>>  
>>
>> I am getting errors when trying to do a win_copy from a remote server to 
>> destinations servers.
>>
>>  
>>
>> The playbook is the following:
>>
>>  
>>
>> ---
>>
>> - name: Copy Website Live Template from server
>>
>>   hosts: all
>>
>>   tasks:
>>
>> - name: Copy Website Live Template from server
>>
>>   win_copy:
>>
>> src: \\10.10.3.169\template\Live\
>>
>> dest: C:\Websites
>>
>>  
>>
>> The error is:
>> fatal: [10.10.3.170]: FAILED! => {"changed": false, "failed": true, 
>> "invocation": {"module_args": {"dest": "C:/Websites", "src": "/
>> 10.10.3.169/template/Live/"}, "module_name": "win_copy"}, "msg": "could 
>> not find src=/10.10.3.169/template/Live"}
>>
>>  
>>
>> I have tried all kinds of variations in the playbook…
>>
>>  
>>
>> src: \10.10.3.169\template\Live
>>
>> dest: C:\Websites
>>
>>  
>>
>> src: /10.10.3.169/template/Live/
>>
>> dest: C:/Websites
>>
>>  
>>
>> But keep getting errors.
>>
>>  
>>
>> Any idea what could be the cause of this?
>>
>>  
>>
>>  
>>
>> Cheers
>>
>

-- 
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/3602b7f6-ed28-4253-9bcb-76edaf99c065%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Adding Multiple Lines to file (Windows Servers)

2016-02-11 Thread 'J Hawkesworth' via Ansible Project
blockinfile is not a windows module unfortunately.

There is an as yet un merged module for manipulating the windows hosts file 
though - perhaps give that a try 
- https://github.com/ansible/ansible-modules-extras/pull/1455

Hope that helps,

Jon


On Thursday, 11 February 2016 10:34:55 UTC, Mark Matthews wrote:
>
> Hi
>
> I am trying to add multiple lines to the host file on some Windows servers.
>
> If I use the following playbook I can add one line:
>
> ---
> - name: Add host file entries
>   hosts: all
>   tasks:
> - name: Check if line is present in config
>   win_lineinfile:
> dest: C:\Windows\System32\drivers\etc\hosts
> line: "x.x.x.x   www.website1.com"
>
>
> I have tried the following, but keep getting errors:
>
> ---
> - name: Add host file entries
>   hosts: all
>   tasks:
> - name: Add host file entries
>   blockinfile:
> dest: C:\Windows\System32\drivers\etc\hosts
> block: 
>   10.10.3.76   www.website1.com
>   10.10.3.77   www.website1.com
>   10.10.3.19   www.website1.com
>   10.10.10.2   www.website1.com
>   10.10.3.74   www.website1.com
>
>
> Does anyone know of way that this can be done?
>

-- 
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/84fa25c5-9c17-4f31-9289-3e360c6510f2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Adding Multiple Lines to file (Windows Servers)

2016-02-11 Thread Mark Matthews
Hi

I am trying to add multiple lines to the host file on some Windows servers.

If I use the following playbook I can add one line:

---
- name: Add host file entries
  hosts: all
  tasks:
- name: Check if line is present in config
  win_lineinfile:
dest: C:\Windows\System32\drivers\etc\hosts
line: "x.x.x.x   www.website1.com"


I have tried the following, but keep getting errors:

---
- name: Add host file entries
  hosts: all
  tasks:
- name: Add host file entries
  blockinfile:
dest: C:\Windows\System32\drivers\etc\hosts
block: 
  10.10.3.76   www.website1.com
  10.10.3.77   www.website1.com
  10.10.3.19   www.website1.com
  10.10.10.2   www.website1.com
  10.10.3.74   www.website1.com


Does anyone know of way that this can be done?

-- 
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/35d2fb16-2c82-4abd-8a10-a1314fd7b859%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Adding Multiple lines to file

2016-02-11 Thread 'J Hawkesworth' via Ansible Project
Lots of examples of the various ways to loop 
here: http://docs.ansible.com/ansible/playbooks_loops.html#standard-loops

Depending on what you are trying to achieve, you might actually find the 
win_template module is easier to work with rather than multiple calls to 
win_lineinfile

Hope this helps,

Jon

On Thursday, 11 February 2016 10:19:56 UTC, Mark Matthews wrote:
>
> Hi Matt
>
> How exactly would that look like in a playbook?
>
> Cheers
> Mark
>
> On Wednesday, February 10, 2016 at 5:11:21 PM UTC, Mark Matthews wrote:
>>
>> Hi
>>
>> I want to add multiple lines to a host file on some Windows machines.
>>
>> I tried using win_lineinfile in the following playbook below...but it 
>> only added the last line.
>>
>> ---
>> - name: Add host file entries
>>   hosts: all
>>   tasks:
>> - name: Check if line is present in config
>>   win_lineinfile:
>> dest: C:\Windows\System32\drivers\etc\hosts
>> line: "x.x.x.x   www.website1.com"
>> line: "x.x.x.x   www.website2.com"
>> line: "x.x.x.x   www.website3.com"
>> line: "x.x.x.x   www.website4.com"
>>
>>
>> Is there a way of doing 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/89966da8-e4f7-4372-923f-9b1f70fc453b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Unpack tar.gz on Windows Server?

2016-02-11 Thread 'J Hawkesworth' via Ansible Project
If you want an example role to install 7zip - have a look in the 
integration tests
test/integration/roles/test-win-msi/

All the best,

Jon

On Wednesday, 10 February 2016 21:55:55 UTC, Slim Slam wrote:
>
> The easiest way seems to be to install 7z http://www.7-zip.org and use 
> that. It can handle zip/gzip/tar easily.
> I'd rather use an ansible module, of course.
>
> J
>
> On Wednesday, February 10, 2016 at 11:44:28 AM UTC-6, Slim Slam wrote:
>>
>> What's the Ansible 2.0 recommended way to unpack a tar.gz file on Windows?
>>
>> It looks like win_unzip can handle gzip'ed files, but what about 
>> unpacking tar archives?
>>
>> J
>>
>

-- 
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/aa682b78-6526-4906-9f2b-09523e9b47c9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] When conditional bug in Ansible 2.0.0.2 ?

2016-02-11 Thread Mark Maas
Hi List,

So I got this great thing here:

```
- name: Copy custom nrpe plugins
  template:
src: "{{ item }}"
dest: "{{ nrpe.plugins }}"
mode: 0755
owner: "{{ nrpe.user }}"
group: "{{ nrpe.user }}"
  tags: update_nrpe
  notify: restart nrpe
  with_fileglob: "../templates/plugins/{{ nrpe_scripts }}/*"
  when: nrpe_scripts is defined
```

Works a treat with 1.9, it would be really easy to add service checks for 
special server cases.
With Ansible 2.0.0.2 this breaks, because 2.0 tries to fill the fileglob 
before looking at the when: conditional. And since the nrpe_scripts is not 
defined for most servers, it breaks!

An ugly hack would be to put a general variable in group_vars/all that just 
makes it look into an empty directory or something.

Is this a bug? or intended?

Thanks,
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/f4fc3672-c449-4b92-bb35-f72a65106919%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Random undefined variables (facts) since ansible 2.0 upgrade

2016-02-11 Thread Michael Baydoun
In our case, the facts are being gathered, and used other plays included in 
site.yml, but later on in a subsequent play the a fact that was defined 
previously is suddenly undefined, on some random hosts, but not all.  It's 
happening on windows and linux hosts.


On Thursday, February 11, 2016 at 2:20:23 AM UTC-5, Alex Leonhardt wrote:
>
> I had something like it, not on Windows though,at the time the problem was 
> that I set it not to gather_facts, when I actually tried to use a few facts 
> later on. May not be the same but may be worth checking..
>
> Alex
>
>
>>

-- 
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/02101a12-2785-4f57-881c-60fef570a05b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] When conditional bug in Ansible 2.0.0.2 ?

2016-02-11 Thread Matt Martz
This is expected.  `when` statements work on each iteration of the `with_`
loop, and as such the `when` statements are effectively inspected *after*
`with_` loops.

Ansible 1.9 may have allowed this to pass due to a bug in logic, however
2.0 is more strict, and is properly failing.

On Thu, Feb 11, 2016 at 7:38 AM, Mark Maas  wrote:

> Hi List,
>
> So I got this great thing here:
>
> ```
> - name: Copy custom nrpe plugins
>   template:
> src: "{{ item }}"
> dest: "{{ nrpe.plugins }}"
> mode: 0755
> owner: "{{ nrpe.user }}"
> group: "{{ nrpe.user }}"
>   tags: update_nrpe
>   notify: restart nrpe
>   with_fileglob: "../templates/plugins/{{ nrpe_scripts }}/*"
>   when: nrpe_scripts is defined
> ```
>
> Works a treat with 1.9, it would be really easy to add service checks for
> special server cases.
> With Ansible 2.0.0.2 this breaks, because 2.0 tries to fill the fileglob
> before looking at the when: conditional. And since the nrpe_scripts is not
> defined for most servers, it breaks!
>
> An ugly hack would be to put a general variable in group_vars/all that
> just makes it look into an empty directory or something.
>
> Is this a bug? or intended?
>
> Thanks,
> 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/f4fc3672-c449-4b92-bb35-f72a65106919%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Matt Martz
@sivel
sivel.net

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


Re: [ansible-project] When conditional bug in Ansible 2.0.0.2 ?

2016-02-11 Thread Mark Maas
Interesting.

But people would expect a time of "deprecated but works" at the least.
And besides, I find the original way more logical. (Which will be so for 
more people, necessitating a deprecation warning,  not a complete failure)

I'm noticing a lot of stuff gone, sort of broken, changed behavior, between 
these two ansible versions. Not good for the mindset of people who I just 
managed to get onboard with Ansible.

Thanks,
Mark

On Thursday, February 11, 2016 at 2:43:21 PM UTC+1, Matt Martz wrote:
>
> This is expected.  `when` statements work on each iteration of the `with_` 
> loop, and as such the `when` statements are effectively inspected *after* 
> `with_` loops.
>
> Ansible 1.9 may have allowed this to pass due to a bug in logic, however 
> 2.0 is more strict, and is properly failing.
>
> On Thu, Feb 11, 2016 at 7:38 AM, Mark Maas  > wrote:
>
>> Hi List,
>>
>> So I got this great thing here:
>>
>> ```
>> - name: Copy custom nrpe plugins
>>   template:
>> src: "{{ item }}"
>> dest: "{{ nrpe.plugins }}"
>> mode: 0755
>> owner: "{{ nrpe.user }}"
>> group: "{{ nrpe.user }}"
>>   tags: update_nrpe
>>   notify: restart nrpe
>>   with_fileglob: "../templates/plugins/{{ nrpe_scripts }}/*"
>>   when: nrpe_scripts is defined
>> ```
>>
>> Works a treat with 1.9, it would be really easy to add service checks for 
>> special server cases.
>> With Ansible 2.0.0.2 this breaks, because 2.0 tries to fill the fileglob 
>> before looking at the when: conditional. And since the nrpe_scripts is not 
>> defined for most servers, it breaks!
>>
>> An ugly hack would be to put a general variable in group_vars/all that 
>> just makes it look into an empty directory or something.
>>
>> Is this a bug? or intended?
>>
>> Thanks,
>> 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-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/f4fc3672-c449-4b92-bb35-f72a65106919%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/c35cccaa-fac6-4732-a5f1-c25d252928dc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] deploying ansible with ansible

2016-02-11 Thread Brian Coca
You can also define hosts D & E with connection settings that use host A as
an ssh proxycommand.


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


Re: [ansible-project] 389 server stops after Ansible "hangs up"

2016-02-11 Thread Joshua J. Kugler
On Thursday, February 11, 2016 09:40:23 Brian Coca wrote:
> command/shell are not good ways of starting services, setup a init
> script/system|upstart configuration instead.
> 
> But "if you must", add `nohup` to the command as Ansible immediately
> terminates the tty and the 'daemon' might not have detached yet or detach
> correctly which can stall/kill the process.
> 
> ​-
> Brian Coca​

Thanks for the suggestion.  I had been using ansible's 'service' module and 
that wasn't working either. I resorted to command/shell modules as a means of 
trouble shooting.

j

-- 
Joshua J. Kugler - Fairbanks, Alaska
Azariah Enterprises - Programming and Website Design
jos...@azariah.com - Jabber: pedah...@gmail.com
PGP Key: http://pgp.mit.edu/  ID 0x73B13B6A

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


[ansible-project] Suppress URI module when combined with UNTIL

2016-02-11 Thread Ben Friedman
I'm interfacing with a REST API using the URI module.  I need to wait until 
the return data from the API has a parameter set to a certain string.  I 
also have to use 'no_log: true' so that the URI module does not print 
sensitive data(uri username/password) to the screen as other 
systems(jenkins) are calling this playbook.

Everything was fine until Ansible 2.0.  Now with 2.0, even with no_log set, 
the URI module will print the request body along with the username and 
password to screen on FAILED attempts, even though it's waiting for the 
'UNTIL' condition to be true.  

Is there any way to disable this output?

Sample task:

- name: wait until the resource responds with a status of ON
  uri:
url: "{{ url }}/resources/{{ item.split('.')[0] }}"
method: GET
user: "{{ user }}"
password: "{{ pass }}"
return_content: yes
validate_certs: no
   register: statusCode_output
   until: statusCode_output.json.statusCode == "ON"
   retries: 30
   delay: 60
   no_log: True
   with_items: groups.created_hosts

So, the functionality still works with 2.0.  However, every 60 seconds, until 
the condition is true, it prints this to the screen.  I've truncated the data 
but basically it's the entire request body, along with my username/password, 
and the response from the API


TASK [resource_project_management : wait until the resource responds with a 
statusCode of ON] ***

*FAILED - RETRYING: TASK: resource_project_management : wait until the resource 
responds with a statusCode of ON (29 retries left). Result was: {u'status': 
200, .*


-- 
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/6bf00791-ae7e-4f37-81ac-484cb5ddaf07%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: ping multiple gateways

2016-02-11 Thread wintelgeeks
If I'm understanding it correctly, you are looking for a way to validate if 
your gateways are pingable. I usually do it using a Excel Ping script where 
i mention the gateway IPs and hit execute to test if they are reachable. 
Link to the script. 
*http://wintelgeeks.com/2016/02/11/script-to-ping-multiple-servers-using-excel/*

On Tuesday, 9 February 2016 14:07:41 UTC-5, Portia Wong wrote:
>
> Currently at my workplace, our hosts have multiple connections to 
> different gateways.  I am trying to find a way to see whether I can easily 
> ping 4-5 gateways by either running an ad-hoc command or through a playbook 
> to help me verify that after each host deployment, connection to those 
> gateways are successful.  Has anybody ever done this before?
>

-- 
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/7d4948d4-33a8-43b5-b87b-19beda3da43a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] ::[ansible-playbook] "--check" as default

2016-02-11 Thread Benjamin Redling
Hi everybody,

is it possible to make "--check" the default behaviour?

I could only think of a wrapper or aliases, but would prefer to set it
in ansible.cfg

I have only found always_run=true as the opposite case

Regards,
Benjamin
-- 
FSU Jena | JULIELab.de/Staff/Benjamin+Redling.html
vox: +49 3641 9 44323 | fax: +49 3641 9 44321

-- 
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/56BCABE7.70503%40uni-jena.de.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] ::[ansible-playbook] "--check" as default

2016-02-11 Thread Brian Coca
It is not currently possible, but you can open a feature request or pull
request to make it so.

On Thu, Feb 11, 2016 at 10:42 AM, Benjamin Redling <
benjamin.ra...@uni-jena.de> wrote:

> Hi everybody,
>
> is it possible to make "--check" the default behaviour?
>
> I could only think of a wrapper or aliases, but would prefer to set it
> in ansible.cfg
>
> I have only found always_run=true as the opposite case
>
> Regards,
> Benjamin
> --
> FSU Jena | JULIELab.de/Staff/Benjamin+Redling.html
> vox: +49 3641 9 44323 | fax: +49 3641 9 44321
>
> --
> 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/56BCABE7.70503%40uni-jena.de
> .
> 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/CACVha7dPKfkLRxeoNrWQp4K0-USxYXV6sQWgQeMd%2BJSiO0etdA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] mount volumes based on size

2016-02-11 Thread Govindaraj Venkatesan
Hi All,

Currently we are mounting the volume as below

  - name: mkfs the volume
filesystem: fstype=ext4 dev=/dev/vdb
tags: mount_zookeeper_fs

is there a way we can mount volumes based on the size? sometimes our 
dev=/dev/vdb changes and is not constant. But the size remains the same.

Thanks,
Govind

-- 
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/bd6853fe-fdc9-4b75-9376-46c70718e4ce%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] lineinfile

2016-02-11 Thread Govindaraj Venkatesan
Hi Team,

I have the file with the below content.

  "Bamboo": {
"Endpoint": "http://xx.xx.xxx.xxx:800;,
"Zookeeper": {
  "Host": "//xx.xxx.xxx.xx:2181,xx.xxx.xxx.xx:2181,xx.xxx.xxx.xx:2181",
  "Path": "/marathon-haproxy/state",
  "ReportingDelay": 5
}
  },

I wanted to dynamically update the below line using lineinfile
"Endpoint": "http://xx.xx.xxx.xxx:800;,

My Ansible has the below code
lineinfile: dest=/var/bamboo/production.json.bak state=present regexp="^ 
 \"Bamboo\"":" {" insertafter="  \"Bamboo\"":"\{" line="\"Endpoint\"":" 
\"http://{{ansible_default_ipv4.address}}:8080\; "

For some reason, it is adding the line to the EOF. 

Can someone please suggest on how can i fix 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/6acbe20e-4e57-4a38-a851-06d140340498%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] iterating over IPv4/IPv6 (parallel) + TCP ports (nested)

2016-02-11 Thread nusenu
Hi,

similar to a question from about a year ago [1], I'm looking for the
best way to loop over 3 lists:

- {{ ansible_all_ipv4_addresses }}
- {{ ansible_all_ipv6_addresses | ipv6('public') }}
- tcpports


ipv4 and ipv6 IPs should iterate in parallel (I'll check that their list
lengths are matching) while tcpports should be combined in nested mode.


I guess this is a common use-case?






[1] https://groups.google.com/d/msg/ansible-devel/aLrH_SC8HyY/Zz91ifV5M-0J

-- 
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/56BD235A.2070107%40openmailbox.org.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: OpenPGP digital signature


[ansible-project] Ansible playbook to deploy a VM in a PXEBOOT envrionment

2016-02-11 Thread Stuart Cracraft
My present Ansible playbook can spin-up a VM in the interactive Ubuntu 
installation (e.g. waiting for you to select the language on the first 
screen), but I've not been able to get it instead to go to the 
PXEBOOT/KICKSTART server on the same network. The P/K works fine when F12 
is pressed and it goes off and builds a complete server of any kind on my 
stack but I want to be able to initiate that with a transformation of the 
Ansible playbook below and have no idea how to do it after a pretty 
thorough review of documents on the Internet. If anyone knows how this can 
be accomplished and could comment, I'd sure appreciate it.

- hosts: 127.0.0.1
  connection: local
  user: root
  sudo: false
  gather_facts: false
  serial: 1

  tasks:
  - vsphere_guest:
  vcenter_hostname: sna-vcsa.SOMEDOMAIN.com
  username: ansible
  password: SOMEPASSWORD
  guest: SOMEHOSTNAME
  state: powered_on
  vm_extra_config:
vcpu.hotadd: yes
mem.hotadd: yes
  vm_disk:
disk1:
 size_gb: 100
 type: thin
 datastore: SOMEDATASTORE
  vm_nic:
nic1:
 type: vmxnet3
 network: SOMENETWORK
 network_type: standard
  vm_hardware:
memory_mb: 2048
num_cpus: 2
osid: ubuntu64Guest
scsi: paravirtual
vm_cdrom:
  type: "iso"
  iso_path: "SOMEISODATASTORE/ISO/ubuntu-14.04.3-server-amd64.iso"
  esxi:
datacenter: SNA
hostname: sna1.SOMEDOMAIN.com

-- 
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/4a79ce46-080b-4a71-a875-8722472e6cf6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Can not attach CM rom in Vmware

2016-02-11 Thread kesten broughton
I saw the same problem and have not found a fix for it yet.

-- 
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/5f7108ad-4d1b-446c-90e8-ae41cfa28790%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: How to Export Ansible Tower job logs

2016-02-11 Thread txavier
Sure, i will contact the same. Thanks much.

Regards
Tom



On Friday, February 12, 2016 at 1:50:29 AM UTC+5:30, txa...@marketshare.com 
wrote:
>
> Hi All,
>
> Can you please help me out to find a way to export Ansible tower job logs 
> (Ex: Job number, Start time, End time etc)
> Thanks in advance.
>
> Regards
> Thomas Xavier
>

-- 
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/7287b0be-fdc1-4e0a-98fd-2dfe09c07fa7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: How do I use multiple ansible versions on the same machine for different playbooks that require specific versions?

2016-02-11 Thread ProfHase
I would propose you to use python's virtualenvs:

virtualenv ansible17
source ansible17/bin/activate
pip install ansible==1.7
# work with it
deactivate
# next time
source ansible17/bin/activate


It is the same approach as you are using, but as virtualenv encapsulates 
the whole environment, so you don't need to bother about the dependencies

Am Mittwoch, 10. Februar 2016 15:27:45 UTC+1 schrieb Philip Kirkland:
>
> Hi all,
>
> Perhaps I'm approaching this the wrong way; I would appreciate some 
> feedback.
>
> We have various playbooks that have been developed over a period of time. 
> Due to the (sometimes) lack of backwards compatibility of ansible, some 
> playbooks might require a specific version. I don't want to run this on 
> different ansible runtime/orchestration servers; I'd like to be able to 
> handle this on the one server.
>
> In previous versions (prior to the core/extras submodule being split out), 
> we could typically download some tar.gz releases and unzip/extract them 
> into different directories. Then prior to running a playbook we could 
> source hacking/env-setup for the specific version that we needed and could 
> run the playbook.
>
> For example:
> source ansible-1.7.2/hacking/env-setup
> # run my ansible-playbook that requires version 1.7.2
>
> source ansible-1.6.3/hacking/env-setup
> #run my ansible-playbook that requires version 1.6.3
>
> The above does not work since the core and extras modules became git 
> submodules as outlined below.
>
> Now I have a couple of options:
>
> 1. Take a release (such as 
> http://releases.ansible.com/ansible/ansible-2.0.0.2.tar.gz). This doesn't 
> have the hacking directory so how do I configure my environment? I don't 
> want to run setup since doing this for different versions will override 
> each other, and running jobs in parallel would certainly get issues if I 
> did this. Hence I don't have an easy mechanism of catering for different 
> versions.
>
> 2. Take a source tar.gz (such as 
> https://github.com/ansible/ansible/archive/v2.0.0.2-1.tar.gz). Whilst 
> this gives me the hacking directory the lib/ansible/modules/core and 
> lib/ansible/modules/extras (which correspond to the git submodules) are 
> empty, so I would need to obtain those as well. How do I get those?
>
> What I think would solve my issue is a tarball that includes all the 
> source (including the git submodules) as well as the hacking directory.
>
> Or am I going about this the wrong way?
>
> Thanks for any help, advice or pointers.
>
> Phil
>
>

-- 
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/a5cf5de3-4089-44a0-a1b4-8be281c60474%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: How do I use multiple ansible versions on the same machine for different playbooks that require specific versions?

2016-02-11 Thread ProfHase
I would propose you to use python's virtualenvs:

virtualenv ansible17
source ansible17/bin/activate
pip install ansible==1.7
# work with it
deactivate
# next time
source ansible17/bin/activate


It is the same approach as you are using, but as virtualenv encapsulates 
the whole environment, so you don't need to bother about the dependencies

Am Mittwoch, 10. Februar 2016 15:27:45 UTC+1 schrieb Philip Kirkland:
>
> Hi all,
>
> Perhaps I'm approaching this the wrong way; I would appreciate some 
> feedback.
>
> We have various playbooks that have been developed over a period of time. 
> Due to the (sometimes) lack of backwards compatibility of ansible, some 
> playbooks might require a specific version. I don't want to run this on 
> different ansible runtime/orchestration servers; I'd like to be able to 
> handle this on the one server.
>
> In previous versions (prior to the core/extras submodule being split out), 
> we could typically download some tar.gz releases and unzip/extract them 
> into different directories. Then prior to running a playbook we could 
> source hacking/env-setup for the specific version that we needed and could 
> run the playbook.
>
> For example:
> source ansible-1.7.2/hacking/env-setup
> # run my ansible-playbook that requires version 1.7.2
>
> source ansible-1.6.3/hacking/env-setup
> #run my ansible-playbook that requires version 1.6.3
>
> The above does not work since the core and extras modules became git 
> submodules as outlined below.
>
> Now I have a couple of options:
>
> 1. Take a release (such as 
> http://releases.ansible.com/ansible/ansible-2.0.0.2.tar.gz). This doesn't 
> have the hacking directory so how do I configure my environment? I don't 
> want to run setup since doing this for different versions will override 
> each other, and running jobs in parallel would certainly get issues if I 
> did this. Hence I don't have an easy mechanism of catering for different 
> versions.
>
> 2. Take a source tar.gz (such as 
> https://github.com/ansible/ansible/archive/v2.0.0.2-1.tar.gz). Whilst 
> this gives me the hacking directory the lib/ansible/modules/core and 
> lib/ansible/modules/extras (which correspond to the git submodules) are 
> empty, so I would need to obtain those as well. How do I get those?
>
> What I think would solve my issue is a tarball that includes all the 
> source (including the git submodules) as well as the hacking directory.
>
> Or am I going about this the wrong way?
>
> Thanks for any help, advice or pointers.
>
> Phil
>
>

-- 
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/5f1fc31d-5906-453c-8d67-bf7ee58b12ac%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: How to make symbolic links in windows via Ansible ?

2016-02-11 Thread 'J Hawkesworth' via Ansible Project
Obviously you will need to connect as an Administrator user.

You don't mention which version of windows you are controlling but you may 
just need to temporarily disable UAC prompt for Administrator users.

On Server 2012 the setting for this is in

 HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System
ConsentPromptBehaviorAdmin
0

set it back to 2 to restore current default behaviour.

Hope this helps.  I have not used mklink though.

Jon

 

On Thursday, 11 February 2016 14:47:40 UTC, ishan jain wrote:
>
> I am trying to make a lot symbolic links for my directories and files and 
> manually i use mklink command to make them. Oddly enough, this command 
> requires admin level privileges to create links. 
>
> How can i use mklink via ansible with admin privileges to create symbolic 
> links ?
>

-- 
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/53064397-f1be-4029-9fb5-f05a201d337d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] ping multiple gateways

2016-02-11 Thread Benjamin Redling
On 2016-02-09 20:04, Portia Wong wrote:
> Currently at my workplace, our hosts have multiple connections to different 
> gateways.  I am trying to find a way to see whether I can easily ping 4-5 
> gateways by either running an ad-hoc command or through a playbook to help 
> me verify that after each host deployment, connection to those gateways are 
> successful.  Has anybody ever done this before?

The following req. /bin/ping -- don't forget to limit the ping count.

$ cat ping-list.yml
# Simple ad hoc gateway ping. Prefer proper monitoring.
---
- hosts: all:my_special_remote_host:!not_the_broken_one

  tasks:

- name: check gateways after deployment
  command: /bin/ping -c3 {{ item }}
  with_items:
  - 192.168.1.1
  - gateway1.example.org

There are more elaborate solutions
In my reading list, not tested (autopinger):
http://jedelman.com/home/network-test-automation-with-ansible/

/Benjamin
-- 
FSU Jena | JULIELab.de/Staff/Benjamin+Redling.html
vox: +49 3641 9 44323 | fax: +49 3641 9 44321

-- 
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/56BCBD74.9090806%40uni-jena.de.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: Copy/Template modules hang on AIX - sh.py

2016-02-11 Thread Brian Coca
There is no need to change ssh.py you can set -T in the ssh arguments
(globally or for the group/hosts) and it will override the -tt as user
options get appended.


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


[ansible-project] Powershell Script playbook no running on servers

2016-02-11 Thread Mark Matthews
Hi

I have a playbook that is running the below powershell script.
If I run the script on the actual server it works perfectly. But when I run 
the playbook nothing happens on the server.
The job returns as changedbut nothing has happened.

The playbook does seem to run quite quickly and I was wondering if Ansible 
is stopping the Powershell job before it completes? Can Ansible do that, or 
does it not have any effect on the script after it has been executed? If it 
does have an efffect on stopping the job are you able to put a wait on the 
job to allow the powershell script to complete?

$InstallPath = "C:\Program Files\Octopus Deploy\Tentacle"
$Server = $InstallPath + "\Tentacle.exe"

# Start-Process "C:\Temp\Octopus.Tentacle.3.0.10.2278-x64.msi" /qn -Wait

Start-Process $Server 'create-instance --instance "Tentacle" --config 
"C:\Octopus\Tentacle.config"' -Wait
Start-Process $Server 'new-certificate --instance "Tentacle" --if-blank' 
-Wait
Start-Process $Server 'configure --instance "Tentacle" --reset-trust' -Wait
Start-Process $Server 'configure --instance "Tentacle" --home "C:\Octopus" 
--app "C:\Octopus\Applications" --port "10933" --noListen "False"' -Wait
Start-Process $Server 'configure --instance "Tentacle" --trust 
"xxx"' -Wait
Start-Process $Server 'service --instance "Tentacle" --install --start' 
-Wait


Cheers
Mark

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


Re: [ansible-project] Re: Global hooks/tasks

2016-02-11 Thread Brian Coca
i would just have something like incron on the target that triggers
etckeeper

On Thu, Feb 11, 2016 at 8:11 AM, Tobias Wolf  wrote:

> We had this discussion over lunch, i.e., we pondered how we could get
> ansible to trigger etckeeper on each host at the conclusion of the
> playbook. We excluded handlers because handlers are not executed once a
> playbook fails.
>
> Did you find a way to cleanly create a hook like this with having to
> append this to each playbook individually?
>
> --Tobias
>
> On Thursday, November 5, 2015 at 4:40:32 PM UTC+1, Dominic Hargreaves
> wrote:
>>
>> Hi,
>>
>> I've had a look around for solutions to this problem, but surprisingly
>> I'm starting to think it's not something supported out of the box with
>> ansible.
>>
>> I would like to define a play or series of plays which are called exactly
>> once on a given group of hosts for each ansible run, at the very start and
>> very end of that run, regardless of which role or roles are being executed.
>> Optionally, the set of tasks at the end could only run if any of the other
>> tasks run changed something (a sort of global_changed state), but this
>> isn't essential. Using ro
>>
>> The use-case is to run etckeeper before and after each run of ansible, to
>> provide a definitive record of what changed on the server (at least as far
>> as the configuration files in /etc go).
>>
>> Does anyone have any suggestions on how I might accomplish this? Would a
>> new feature request be appropriate if it's not already achievable? Note
>> that I wouldn't want to have to modify every playbook and/or role to
>> achieve this, since that would inevitably lead to missed commits and
>> default the point of having a complete changelog.
>>
>> Just in case it isn't obvious: yes, I am managing the ansible playbooks
>> in git already, but etckeeper provides a deeper view of what *actually*
>> changed on the server and can be very helpful for looking back to figure
>> out when/how something was misconfigured.
>>
>> I would be interested to hear other solutions to this.
>>
>> Cheers,
>> Dominic.
>>
> --
> 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/1a612708-41a9-4ae1-8f8d-c5d2fa85ea19%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/CACVha7eh_sGFyugBFGSWutK0EVmXCJQ2Ki%2B3%2BS0bmHP7Z9ndgw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Random undefined variables (facts) since ansible 2.0 upgrade

2016-02-11 Thread 'J Hawkesworth' via Ansible Project
Do you have fact gathering set to smart in your ansible.cfg?

On Thursday, 11 February 2016 13:28:38 UTC, Michael Baydoun wrote:
>
> In our case, the facts are being gathered, and used other plays included 
> in site.yml, but later on in a subsequent play the a fact that was defined 
> previously is suddenly undefined, on some random hosts, but not all.  It's 
> happening on windows and linux hosts.
>
>
> On Thursday, February 11, 2016 at 2:20:23 AM UTC-5, Alex Leonhardt wrote:
>>
>> I had something like it, not on Windows though,at the time the problem 
>> was that I set it not to gather_facts, when I actually tried to use a few 
>> facts later on. May not be the same but may be worth checking..
>>
>> Alex
>>
>>
>>>

-- 
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/93dcbb29-7f05-487b-b030-4554db9b7c97%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Adding Multiple Lines to file (Windows Servers)

2016-02-11 Thread Mark Matthews
Thanks Jon

I will take a look at the link and see if it can help me.

Cheers

On Thursday, February 11, 2016 at 10:34:55 AM UTC, Mark Matthews wrote:
>
> Hi
>
> I am trying to add multiple lines to the host file on some Windows servers.
>
> If I use the following playbook I can add one line:
>
> ---
> - name: Add host file entries
>   hosts: all
>   tasks:
> - name: Check if line is present in config
>   win_lineinfile:
> dest: C:\Windows\System32\drivers\etc\hosts
> line: "x.x.x.x   www.website1.com"
>
>
> I have tried the following, but keep getting errors:
>
> ---
> - name: Add host file entries
>   hosts: all
>   tasks:
> - name: Add host file entries
>   blockinfile:
> dest: C:\Windows\System32\drivers\etc\hosts
> block: 
>   10.10.3.76   www.website1.com
>   10.10.3.77   www.website1.com
>   10.10.3.19   www.website1.com
>   10.10.10.2   www.website1.com
>   10.10.3.74   www.website1.com
>
>
> Does anyone know of way that this can be done?
>

-- 
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/261353ae-1714-41c4-92a2-cc81e3cb7721%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Adding Multiple lines to file

2016-02-11 Thread Mark Matthews
Hi Jon

Thanks for the response.
I was actually able to find a work around. Not a great solution, so will 
look at win_template.

--- 
- name: Add host file entries 
hosts: all 
tasks: 
  - name: Add host file entries 
win_lineinfile: 
   dest: C:\Windows\System32\drivers\etc\hosts 
   line: | 

 x.x.x.x www.wesite1.com\r\n  
 x.x.x.x www.wesite2.com\r\n  
 x.x.x.x www.wesite3.com\r\n  
 x.x.x.x www.wesite4.com\r\n  
 x.x.x.x www.wesite5.com


Cheers
Mark


On Wednesday, February 10, 2016 at 5:11:21 PM UTC, Mark Matthews wrote:
>
> Hi
>
> I want to add multiple lines to a host file on some Windows machines.
>
> I tried using win_lineinfile in the following playbook below...but it only 
> added the last line.
>
> ---
> - name: Add host file entries
>   hosts: all
>   tasks:
> - name: Check if line is present in config
>   win_lineinfile:
> dest: C:\Windows\System32\drivers\etc\hosts
> line: "x.x.x.x   www.website1.com"
> line: "x.x.x.x   www.website2.com"
> line: "x.x.x.x   www.website3.com"
> line: "x.x.x.x   www.website4.com"
>
>
> Is there a way of doing 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/fe5fe97c-26c6-4f75-a854-39c5997e90f6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Powershell Script playbook no running on servers

2016-02-11 Thread 'J Hawkesworth' via Ansible Project
Hmm, not sure what is going on there.

Try running with -v so you can see stdout from script module output

Also check the event log to see if there is anything there.

When run on the server do  you have accept UAC prompt?  Might need to turn 
that off to run remotely via ansible.

Hope this helps,

Jon

On Thursday, 11 February 2016 17:11:31 UTC, Mark Matthews wrote:
>
> Hi
>
> I have a playbook that is running the below powershell script.
> If I run the script on the actual server it works perfectly. But when I 
> run the playbook nothing happens on the server.
> The job returns as changedbut nothing has happened.
>
> The playbook does seem to run quite quickly and I was wondering if Ansible 
> is stopping the Powershell job before it completes? Can Ansible do that, or 
> does it not have any effect on the script after it has been executed? If it 
> does have an efffect on stopping the job are you able to put a wait on the 
> job to allow the powershell script to complete?
>
> $InstallPath = "C:\Program Files\Octopus Deploy\Tentacle"
> $Server = $InstallPath + "\Tentacle.exe"
>
> # Start-Process "C:\Temp\Octopus.Tentacle.3.0.10.2278-x64.msi" /qn -Wait
>
> Start-Process $Server 'create-instance --instance "Tentacle" --config 
> "C:\Octopus\Tentacle.config"' -Wait
> Start-Process $Server 'new-certificate --instance "Tentacle" --if-blank' 
> -Wait
> Start-Process $Server 'configure --instance "Tentacle" --reset-trust' -Wait
> Start-Process $Server 'configure --instance "Tentacle" --home "C:\Octopus" 
> --app "C:\Octopus\Applications" --port "10933" --noListen "False"' -Wait
> Start-Process $Server 'configure --instance "Tentacle" --trust 
> "xxx"' -Wait
> Start-Process $Server 'service --instance "Tentacle" --install --start' 
> -Wait
>
>
> Cheers
> Mark
>

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


Re: [ansible-project] Possible to loop over conditional variables?

2016-02-11 Thread Brian Huddleston
Thanks for the feedback, it took a bit for me to understand.  I think I 
might be better off declare them individually in my example since that is 
much easier for other to read and add to and I can see possible text errors 
with all the brackets and parens that have to be used for each additional 
item. (say I wanted to add 3 more variables to check)

On Monday, February 8, 2016 at 10:22:38 AM UTC-8, Brian Coca wrote:
>
> when executes inside the loop so it cannot prevent undefined errors, 
> the following does a union of the lists but makes sure to default each 
> to an empty list in case they are undefined: 
>
> with_items:"{{nginx_domain|default([])|union(nginx_port|default([]))}}" 
>
>
>
>
> -- 
> 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/c3e00435-0d45-48b8-9595-eabedd606ce8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Random undefined variables (facts) since ansible 2.0 upgrade

2016-02-11 Thread Michael Baydoun
Turning off fact caching completely did not improve the situation.

On Thursday, February 11, 2016 at 12:32:02 PM UTC-5, Michael Baydoun wrote:
>
> We do, and have been looking at that.  The facts for all hosts are getting 
> gathered/refreshed during the first included playbook in site.yml, and the 
> cache is not supposed to be expiring for 3 hours, with our entire run 
> taking less than 2 hours.  The cache files are present on disk, etcetera.  
>
> We did launch a site.yml run with fact caching commented out of 
> ansible.cfg, waiting to see how that run works.
>
> On Thursday, February 11, 2016 at 11:48:36 AM UTC-5, J Hawkesworth wrote:
>>
>> Do you have fact gathering set to smart in your ansible.cfg?
>>
>>
>

-- 
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/f26c963c-8d6b-4642-8bde-c558b50d9cd7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Adding Multiple lines to file

2016-02-11 Thread Mark Matthews
Hi Matt

How exactly would that look like in a playbook?

Cheers
Mark

On Wednesday, February 10, 2016 at 5:11:21 PM UTC, Mark Matthews wrote:
>
> Hi
>
> I want to add multiple lines to a host file on some Windows machines.
>
> I tried using win_lineinfile in the following playbook below...but it only 
> added the last line.
>
> ---
> - name: Add host file entries
>   hosts: all
>   tasks:
> - name: Check if line is present in config
>   win_lineinfile:
> dest: C:\Windows\System32\drivers\etc\hosts
> line: "x.x.x.x   www.website1.com"
> line: "x.x.x.x   www.website2.com"
> line: "x.x.x.x   www.website3.com"
> line: "x.x.x.x   www.website4.com"
>
>
> Is there a way of doing 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/d536e1ed-2e70-4253-a075-d1d79d9bd6c1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: galaxy vs. Ubuntu 15.10

2016-02-11 Thread Chris Houseknecht
As taken from meta/main.yml created using `ansible-galaxy init` after 
Ubuntu Wily was added:

#- name: Ubuntu
  #  versions:
  #  - all
  #  - lucid
  #  - maverick
  #  - natty
  #  - oneiric
  #  - precise
  #  - quantal
  #  - raring
  #  - saucy
  #  - trusty
  #  - utopic
  #  - vivid
  #  - wily


Ubuntu releases are by name rather than version, so you'll want to use 
'wily'.


On Thursday, February 11, 2016 at 4:02:04 AM UTC-5, nusenu wrote:
>
>
>
> Chris Houseknecht: 
> > Task runner infrastructure upgraded. Hopefully we'll see better 
> > performance. 
>
> thanks. 
>
> > Added Ubuntu Wily. 
>
> Does one has to use the codename?  "15.10" does not seem to work still. 
>
>

-- 
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/985fc1c1-58dd-4d34-963d-1ccec031599d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Random undefined variables (facts) since ansible 2.0 upgrade

2016-02-11 Thread Michael Baydoun
We do, and have been looking at that.  The facts for all hosts are getting 
gathered/refreshed during the first included playbook in site.yml, and the 
cache is not supposed to be expiring for 3 hours, with our entire run 
taking less than 2 hours.  The cache files are present on disk, etcetera.  

We did launch a site.yml run with fact caching commented out of 
ansible.cfg, waiting to see how that run works.

On Thursday, February 11, 2016 at 11:48:36 AM UTC-5, J Hawkesworth wrote:
>
> Do you have fact gathering set to smart in your ansible.cfg?
>
>


-- 
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/df7a26ca-f8de-4712-bd1a-2a7d3235bd83%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Suppress URI module when combined with UNTIL

2016-02-11 Thread Brian Coca
this is a bug, please open a ticket in github using
https://raw.githubusercontent.com/ansible/ansible/devel/ISSUE_TEMPLATE.md

On Thu, Feb 11, 2016 at 11:16 AM, Ben Friedman  wrote:

> I'm interfacing with a REST API using the URI module.  I need to wait
> until the return data from the API has a parameter set to a certain
> string.  I also have to use 'no_log: true' so that the URI module does not
> print sensitive data(uri username/password) to the screen as other
> systems(jenkins) are calling this playbook.
>
> Everything was fine until Ansible 2.0.  Now with 2.0, even with no_log
> set, the URI module will print the request body along with the username and
> password to screen on FAILED attempts, even though it's waiting for the
> 'UNTIL' condition to be true.
>
> Is there any way to disable this output?
>
> Sample task:
>
> - name: wait until the resource responds with a status of ON
>   uri:
> url: "{{ url }}/resources/{{ item.split('.')[0] }}"
> method: GET
> user: "{{ user }}"
> password: "{{ pass }}"
> return_content: yes
> validate_certs: no
>register: statusCode_output
>until: statusCode_output.json.statusCode == "ON"
>retries: 30
>delay: 60
>no_log: True
>with_items: groups.created_hosts
>
> So, the functionality still works with 2.0.  However, every 60 seconds, until 
> the condition is true, it prints this to the screen.  I've truncated the data 
> but basically it's the entire request body, along with my username/password, 
> and the response from the API
>
>
> TASK [resource_project_management : wait until the resource responds with a 
> statusCode of ON] ***
>
> *FAILED - RETRYING: TASK: resource_project_management : wait until the 
> resource responds with a statusCode of ON (29 retries left). Result was: 
> {u'status': 200, .*
>
>
> --
> 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/6bf00791-ae7e-4f37-81ac-484cb5ddaf07%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/CACVha7d2R1gWo4g5N3eO0BY5vFbJoPXvxqZzdW0n_FE_j30tBQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.