Re: [ansible-project] file module - state=touch always finishes as changed

2015-12-28 Thread Matt Martz
I actually tend to use the copy module, like so: - copy: content="" dest=/path/to/file force=no force=no keeps it from replacing the file when it exists and the content is different. http://docs.ansible.com/ansible/copy_module.html On Monday, December 28, 2015, Koji Tanaka wrote: > Hello Ansi

[ansible-project] Re: file module - state=touch always finishes as changed

2015-12-28 Thread Koji Tanaka
RESOLVED. I found that adding "changed_when: False" does the trick, as suggested on this issue. https://github.com/ansible/ansible-modules-core/issues/170 Thank you, Koji On Mon, Dec 28, 2015 at 10:27 PM, Koji Tanaka wrote: > Hello Ansible Community, > > I'd like to create a task which ensures

[ansible-project] file module - state=touch always finishes as changed

2015-12-28 Thread Koji Tanaka
Hello Ansible Community, I'd like to create a task which ensures a file exists(if a file doesn't exist, it should create an empty file). Now I use file module's state=touch, but it always finishes as changed. Is there a way to prevent it from touching when file exists? Best regards, Koji -- You

[ansible-project] Best way to Include Roles in tasks

2015-12-28 Thread Colin Byrne
So I used to have one fairly long main.yml playbook that was used to perform a number of similar-tasks, one of which was to install rbenv, the ruby management tool. --- - name: create group titled deploy group: name=deploy state=present - name: update apt-cache sudo: yes apt

[ansible-project] Autoscaling using "Ansible-pull" with AWS instances for Master and Slave configuration

2015-12-28 Thread Bhotu
I am working with AWS instances currently and want to transfer all the configuration that is currently running on AWS master node to the multiple AWS slave nodes with Ansible only. Slave nodes may be 2 or 3 or may be more. Is it possible with the Ansible-Pull model to automatically scale the

[ansible-project] How to distribute file per server?

2015-12-28 Thread Jakov Sosic
Hi guys, sorry if this is a newbie question, but looking around I couldn't find an answer... I have my own CA, and create x509 key and certificate for each server. What is the best way to distribute them with ansible? Currently, they are distributed via host_vars, and certificate contents i

Re: [ansible-project] Connect to host - SSH Tunnel

2015-12-28 Thread Alex Leonhardt
Never really looked into it, but if/when using netcat, does that mean that from your proxy host / bastion to the target host, the connection is in clear text? I would assume that to be the case? Alex On 28 Dec 2015 12:11 a.m., "Tim Fletcher" wrote: > Would using a netcat tunnel work for you? > >

[ansible-project] Re: failed_when to fail after retries have been used

2015-12-28 Thread jepper
I may try to check the value of "attempts", and fail the task if we reach 10 attempts. On Friday, 18 December 2015 12:01:23 UTC, jepper wrote: > > I am looking for a way for below to cause a failure, if the health check > fails to see an "UP" message after 10 attempts. > > - name: health check

[ansible-project] Re: In Ansible, how to get a variable from another variable and then fetch it's value

2015-12-28 Thread Pradeep Reddy
Ignore pre_tasks in second play. The thing to note is the usage of hostvars. On Monday, December 28, 2015 at 12:50:57 AM UTC+5:30, Arbab Nazar wrote: > > Here is my problem I need to use one variable 'RDS_SG_NAME' and then > append '_id' to it's value to get another variable name which value I

[ansible-project] Re: In Ansible, how to get a variable from another variable and then fetch it's value

2015-12-28 Thread Pradeep Reddy
I do this generally, if I want to use a variable name as a value to another variable --- > > - hosts: localhost > connection: local > gather_facts: no > pre_tasks: > - set_fact: > abc_id: 'some-value' > RDS_SG_NAME: 'abc' > > - hosts: localhost > connection: local > gathe

[ansible-project] Intermittent error "failed to resolve remote temporary directory from"

2015-12-28 Thread Pradeep Reddy
I keep getting this error once in every 4/5 times. fatal: [xxx]: FAILED! => {"failed": true, "msg": "ERROR! failed to resolve remote temporary directory from ansible-tmp-1451292385.49-145367138177040: `( umask 22 && mkdir -p \"$( echo $HOME/.ansible/tmp/ansible-tmp-1451292385.49-14536713817