Re: [ansible-project] Nesting Playbooks?

2015-11-20 Thread Slim Slam
That was it. Thanks. J On Thursday, November 19, 2015 at 7:44:03 PM UTC-6, Timothy Gerla wrote: > > Since build_soft.yml is a full playbook and not just a list of tasks, like > set_os.yml, the include shouldn't be indented to the same level. Try > de-denting the build_soft.yml as far left as

[ansible-project] remote_user var persists between plays?

2015-11-20 Thread Slim Slam
Ansible v1.9.4 I have a playbook that I launch with: $ ansible-playbook build.yml build.yml includes set_os.yml (just a set of tasks) that launches some ec2 instances. build.yml looks like this. - name: Build stuff hosts: localhost sudo: False gather_facts: False tasks: - include:

[ansible-project] Re: Playbook acting on multiple hosts

2015-11-20 Thread Bhotu
Let us say, I have four servers. A,B,C and D. I want to deploy SSH public keys from A to C and also from C to D. How can I do with ansible playbook ? On Saturday, 3 August 2013 07:19:19 UTC-7, Sylvain Wallez wrote: > > Hi there, > > I've recently fallen in love with Ansible and I'm

[ansible-project] pip install paramiko install fails.

2015-11-20 Thread Chandra Kumar Bitra
I am trying to install paramiko and it is failing. Below is the complete error. $ sudo pip install paramiko Requirement already satisfied (use --upgrade to upgrade): paramiko in /usr/lib/python2.6/site-packages/paramiko-1.16.0-py2.6.egg Collecting pycrypto!=2.4,>=2.1 (from paramiko)

[ansible-project] creating directories (mkdir -p)

2015-11-20 Thread Bobby Billingsley
I'm trying to create a subdirectory (to a not-necessarily existing directory) and failing utterly :-( So far I've tried: - name: ensure config dir exists file: path={{base_dir}}/config state=directory mode=0755 tags: myprog,confdir base_dir is defined in the appropriate

[ansible-project] Multiple (differing) actions and with_items

2015-11-20 Thread grant
Hi all, I'm fairly new to Ansible and have an issue I haven't been able to answer. I might be attacking it the wrong way, so I'd appreciate any pointers. I have a number of docker images that need to be started, but I need to make sure the web server inside those docker containers is running

[ansible-project] How to get hostvars in dynamically matched playbook?

2015-11-20 Thread Nicolas Neubauer
Hi, I have a dynamic inventory of ec2 hosts that have tags to declare how those should be provisioned. My use-case is as follows: - 1 EC2 host has a tag "tomcat" and "use" - 2 EC2 hosts have a tag "mysql" one of them has a tag "use" on of them has a tag "dont-use" I'd like to provision

[ansible-project] The ansible process abruptly stops running

2015-11-20 Thread Ivan Nunes
Hello, I have a "playbook" that performs tasks on 15 servers. But sometimes the process simply does not stop running. The process is abruptly stopped. The playbook runs the night shift by cron. I have no idea how to debug this problem. The ansible logs does not help much. Sometimes the log is

[ansible-project] tmp file permissions issues with sudo user

2015-11-20 Thread Arunagiri
Hi All, We are facing issues while starting tomcat with sudo user and uses Ansible tower to setup credentials, tasks and execute them. We have two users defined, *user1* is ssh user to machine and *user2* a sudo user. This is a simple play book *tomcat_test.yml* - hosts: myhost roles:

[ansible-project] VMware and ansible

2015-11-20 Thread Pär Berge
Hi, I would like to use ansible for the whole "chain" when setting up a virtual machine in VMWare. For me it would be leveraging ansible to perform a clone on a specific VM, and then change properties in the clone. I see that ansible have an module for this:

[ansible-project] Copying files with a mode 400 seems to set to 620 instead

2015-11-20 Thread gary . rutland
Hey, This is potentially something that is frowned upon, but I'm trying to add SSH keys to a server via Ansible so that the destination server can use these keys later for other operations. So I am trying to do the following: - name: add default ssh keys become: true copy:

[ansible-project] How to copy file from locate to remote host with dzdo method?

2015-11-20 Thread Andrey Maraev
Hello there! I try to use ansible-playbook. (*ansible 1.9.4, Ubuntu 14.04*) I have dzdo -l permission like: (root) /bin/cp * /usr/local/bin So, I wanna copy a script file from local machine to remote /usr/local/bin plz see playbook.yml below: --- - name: Copy scrypt file into /usr/local/bin

[ansible-project] How to copy files om remote host via dzdo privileges

2015-11-20 Thread Andrey Maraev
Hello there! I try to use ansible-playbook. I have dzdo -l permission like: (root) /bin/cp * /usr/local/bin So, I wanna copy a script file from local machine to remote /usr/local/bin plz see playbook.yml below: --- - name: Copy scrypt file into /usr/local/bin hosts: icinga gather_facts: no

[ansible-project] Undefined variable exception while evaluating Do-Until loop

2015-11-20 Thread graywulf0
My Do-Until loop errors out if the until condition checks against a value that happens to contain a string like "{{ var }}". I stepped through the Ansible code and it attempts to evaluate "var" then throws an undefined variable exception. I have no control over what echo_result.stdout

[ansible-project] a way to automatically pass vault password when running ansible playbook

2015-11-20 Thread Michał Klasiński
Hi, What i am trying to do : ansible-playbook -i playbooks/hosts/vt-hosts playbooks/vault-test.yml --ask-vault-pass I have some properties encrypted using vault. The idea i want to code is to combine using some CI tool like Team City asking for vault password and then running ancible

[ansible-project] Package module returns error 'package' is not a valid attribute for a Play

2015-11-20 Thread Brian Dunbar
All, This made me unreasonably excited. http://docs.ansible.com/ansible/package_module.html And end to having to define multiple statements for each 'linux distro'. Neat! 'Installed' Ansible 2 locally .. $ ansible --version ansible 2.0.0 (devel 591c81e95f) last updated 2015/11/20 10:08:09

[ansible-project] Check package version

2015-11-20 Thread MIkeJ
Hello, I want to run a check in my playbook for the current version of ruby package installed and if its not the version Im expecting then fail the play. How can I go about doing this? Thanks Mike -- You received this message because you are subscribed to the Google Groups "Ansible

Re: [ansible-project] Using ansible inside docker

2015-11-20 Thread Brian Coca
check with 2.0, the service module had issues detecting the correct service system inside docker because of how docker setup things, we fixed several corner cases in the latest version of the service module. it might have worked 'better' in older versions as detection failed in other ways even in

[ansible-project] Action when process stops appending to a file

2015-11-20 Thread tom rkba
How do I get Ansible to monitor a log file and take an action when the process stops appending? I have a high volume process that we'll drain before stopping it. The process will have queued a significant number of transactions just prior being placed in administrative mode. The process will

[ansible-project] Re: Check package version

2015-11-20 Thread MIkeJ
An example of what I think might work. - name: Verify ruby version is 1.9 shell: echo /opt/vagrant_ruby/bin/ruby --version register: status - fail: "This is bad version" when: var=status.stdout_lines != "1.9" On Friday, November 20, 2015 at 11:51:57 AM UTC-8, MIkeJ

Re: [ansible-project] remote_user var persists between plays?

2015-11-20 Thread Matt Martz
set_fact sets a variable for the hosts that are in the play. It does not set global variables. As such, if you target different hosts between the different plays, then you do not have direct access to that fact, as it was set on another host. On Friday, November 20, 2015, Slim Slam

Re: [ansible-project] Package module returns error 'package' is not a valid attribute for a Play

2015-11-20 Thread Matt Martz
That file you reference is a role task file, not a playbook. As such you cannot run it with ansible-playbook. You will have to create a proper playbook to execute that role. On Friday, November 20, 2015, Brian Dunbar wrote: > All, > > This made me unreasonably excited.

Re: [ansible-project] remote_user var persists between plays?

2015-11-20 Thread Brian Coca
vars should still be there though, hostvars['original_host']['varname'] should allow you to see the var from another host. -- 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

Re: [ansible-project] Copying files with a mode 400 seems to set to 620 instead

2015-11-20 Thread Matt Martz
Check out the following comment from github: https://github.com/ansible/ansible/issues/13159#issuecomment-156482308 Short answer is that you need to use 0400 instead of 400 so that Ansible knows you are supplying an octal mode as opposed to decimal. On Thursday, November 19, 2015,

Re: [ansible-project] Package module returns error 'package' is not a valid attribute for a Play

2015-11-20 Thread Brian Dunbar
D'oh. On Friday, November 20, 2015 at 3:35:31 PM UTC-6, Matt Martz wrote: > > That file you reference is a role task file, not a playbook. As such you > cannot run it with ansible-playbook. > > You will have to create a proper playbook to execute that role. > > On Friday, November 20, 2015,

[ansible-project] Re: remote_user var persists between plays?

2015-11-20 Thread Slim Slam
This: http://stackoverflow.com/questions/31708736/passing-variables-between-nested-playbooks suggests that if I change the "hosts" (which I do), then the set_fact vars are NOT persisted between plays. Correct? J On Friday, November 20, 2015 at 11:25:55 AM UTC-6, Slim Slam wrote: > > Ansible

[ansible-project] Re: Ansible 2.0 RC1 is available for testing!

2015-11-20 Thread John Peacock
Is there a document anywhere that describes the changes and/or recommendations to migrate playbooks from 1.9.x to 2.0.0 (I'm not seeing anything obvious)? I installed 2.0.0 and attempted to run an existing playbook and it fell over immediately. It appears that variable scope has changed in

Re: [ansible-project] Re: Ansible 2.0 RC1 is available for testing!

2015-11-20 Thread Brian Coca
The changelog has most of the things you need to look at https://github.com/ansible/ansible/blob/stable-2.0/CHANGELOG.md Variable scope has not changed, precedence has been clarified and templating has been defered to the last possible moment. These last 2 have made it possible to fix many silent

[ansible-project] How to Copy file1 from server A to server B; then Copy file2 from server C to D in Ansible ?

2015-11-20 Thread Bhotu
I want to copy files from one server to another using Ansible. Below is the example Server A --> Server B Server C --> Server D I have my one file on Server A and specifically want to copy that file on to the server B, and same for server C to D. Folder to save files to the

Re: [ansible-project] remote_user var persists between plays?

2015-11-20 Thread Slim Slam
Ok. That works: --- - name: Configure the EC2 instance hosts: ec2hosts gather_facts: true remote_user: "{{ hostvars['localhost']['ruser'] }}" tasks: - do something.. That seems somewhat sub-optimal but since I'm generating all the vars dynamically (via set_fact or include_vars

Re: [ansible-project] Re: How to define host var and append values to it from task

2015-11-20 Thread Brian Coca
You can try this: list1|union(list2) it will output a list with the unique elements from both lists. -- 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

Re: [ansible-project] Re: Check package version

2015-11-20 Thread Brian Coca
try this: - name: Verify ruby version is 1.9 shell: /opt/vagrant_ruby/bin/ruby --version |awk '{print $2}' register: status - fail: "This is bad version" when: status.stdout|version_compare("1.9", "eq") `echo` is not needed as `ruby --version` already prints to screen,

[ansible-project] Re: [ansible-announce] Ansible 2.0 RC1 is available for testing!

2015-11-20 Thread Matt Martz
I would also recommend creating a new thread on ansible-project with any problems you are having. Generally speaking, 2.0 should be backwards compatible, and if you are having issues with a playbook that ran fine, we should probably know a little more about it to determine if it is an issue with

[ansible-project] Override dictionnary value

2015-11-20 Thread Pierre Mavro
Hi, I've got a dictionary in a vars file like that: dicname: dic1: key1: value key2: value dic2: key1: value key2: value I'd like to change the value of a key in the dict with ansible-playbook cli. I've tried things like that: ansible-playbook -e