[ansible-project] script module show job successed but the job is failed or not work

2016-12-12 Thread Ray Tan
Hi Everybody, I want to startup tomcat by script module . The running output show the script is successful at target machine but actually tomcat do not startup. I try same script by command module. I meet same issue. If I directly run the script at target machine, the tomcat can startup. My

Re: [ansible-project] Modify ansible default system facts

2016-12-12 Thread Kai Stian Olstad
On 08.12.2016 04:06, colynn@chinanetcloud.com wrote: As titile, Could we redefined ansible default system facts. eg: default "ansible_env.PWD" is "/root" But I want to change it to specific directory. shall I do ? Why would you do that? Why not create your own facts/variables instead?

Re: [ansible-project] Re: Tasks are not executed in the order defined in With_dict

2016-12-12 Thread 'Felix Fontein' via Ansible Project
Hi, you can have a list of dicts: patches: - name: patch1 patch_name: patch_md5: engine: Services: - name: patch2 patch_name: patch_md5: engine: Services: Then instead of item.key and item.value.xxx, use item.name and item.xxx when using "with_items: {{patches}}". Cheers, Felix

Re: [ansible-project] Re: Tasks are not executed in the order defined in With_dict

2016-12-12 Thread Kai Stian Olstad
On 13.12.2016 07:27, Deepa Yr wrote: Thanks. I have many more fields defined for patch other than patch_name. In that case, it would be difficult to use with_items right.. or Is there a solution with list and with_items ? patches: patch1: patch_name: patch_md5:

[ansible-project] Re: Tasks are not executed in the order defined in With_dict

2016-12-12 Thread Deepa Yr
Thanks. I have many more fields defined for patch other than patch_name. In that case, it would be difficult to use with_items right.. or Is there a solution with list and with_items ? patches: patch1: patch_name: patch_md5: engine: Services: patch2:

Re: [ansible-project] IAM Roles with Ansible

2016-12-12 Thread Vincent Van der Kussen
Hi, I believe it is 'tasks:' Vincent On 12 Dec 2016 11:45 p.m., "Dan" wrote: > # Example of role with custom trust policy for Lambda service > --- > task: > - name: Assign a policy called Admin to the administrators group > iam_policy: > region: us-east-1 >

Re: [ansible-project] Conditional skipped?

2016-12-12 Thread Kai Stian Olstad
On 12.12.2016 20:50, John Oliver wrote: My little playbook: - hosts: all become: true become_user: root become_method: sudo tasks: - name: Update McAfee virus definitions shell: /opt/McAfee/LinuxShield/bin/nails task --run 1 register: result - name: Update McAfee virus

[ansible-project] Ansible Tower 3.0.2 and Boto

2016-12-12 Thread Girish Khadke
Hi, I am running following stack for ansible : Ansible Tower 3.0.2 Ansible 2.1.1.0 (that comes default on Tower 3.0.2) Below is the output of pip freeze on Ansible Tower CentOS 6.8 machine which shows any python packages that are there on my Ansible Tower image : ansible==2.1.1.0

Re: [ansible-project] trouble using sros modules to log in with a specific user

2016-12-12 Thread Peter Sprygada
Hi Nick, Not sure if you figure this out yet or not but you need to add connection: local to your playbook. Your updated playbook should look like this: https://gist.github.com/privateip/2482751b36b30eb60151e94e16c905ea Peter On Tue, Nov 29, 2016 at 7:47 PM, Nick Keeling

[ansible-project] Variable not defined error

2016-12-12 Thread Elliott Barrere
Hi there — I have a variable called pbis_require_membership_of defined in group_vars/all.yaml, and it is overridden for a particular host under role/vars/hostname, however neither of the values are being used at runtime and the module errors with pbis_require_membership_of' is undefined

[ansible-project] IAM Roles with Ansible

2016-12-12 Thread Dan
# Example of role with custom trust policy for Lambda service --- task: - name: Assign a policy called Admin to the administrators group iam_policy: region: us-east-1 profile: dev iam_type: role iam_name: test policy_name: Admin state: present policy_document:

[ansible-project] Getting lost in nesting

2016-12-12 Thread John Oliver
I have a master playlist, global.yml, in which I specified hosts, become, and includes for different OSes That worked fine until I went to add handlers. In my included playbooks, I did something like: - handlers - name: handler 1 etc etc - tasks: - name: Task 1 etc etc At that

Re: [ansible-project] Conditional when any of several tasks has been done

2016-12-12 Thread John Oliver
Darn it, I forgot all about handlers! -- 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,

Re: [ansible-project] Conditional when any of several tasks has been done

2016-12-12 Thread Kai Stian Olstad
On 12. des. 2016 20:06, John Oliver wrote: Let's say I have a playbook that looks for and changes lines in sshd_config if necessary. Then I want the sshd service to be restarted only if at least one of those actions has taken place. Is there a way to evaluate for that without registering a

[ansible-project] Re: Conditional when any of several tasks has been done

2016-12-12 Thread John Oliver
Thanks, Spike. That's what I'll do. That, or a hash. On Monday, December 12, 2016 at 11:15:37 AM UTC-8, Spike Robinson wrote: > > In the specific case of modifying one file only, multiple times, you could > get away with one register for the original modification timestamp, and > then compare

[ansible-project] Conditional skipped?

2016-12-12 Thread John Oliver
My little playbook: - hosts: all become: true become_user: root become_method: sudo tasks: - name: Update McAfee virus definitions shell: /opt/McAfee/LinuxShield/bin/nails task --run 1 register: result - name: Update McAfee virus definitions 2 shell:

Re: [ansible-project] Re: ansible wait_for ssh for a specific user

2016-12-12 Thread Reza ISSANY
i have add the vvv to ansible and to ssh command. The log provided comes from this run. I don't have more logs. I will try tomorrow to make a new run just with the wait task. reza Le 12 déc. 2016 20:12, "Guilherme Ueno" a écrit : > Reza, > > You have to put the

[ansible-project] Re: Conditional when any of several tasks has been done

2016-12-12 Thread Spike Robinson
In the specific case of modifying one file only, multiple times, you could get away with one register for the original modification timestamp, and then compare that timestamp with the current timestamp as your last operation. In the general case, I think you need to use a register with a

Re: [ansible-project] Re: ansible wait_for ssh for a specific user

2016-12-12 Thread Guilherme Ueno
Reza, You have to put the parameter at the end of command, like: ansible-playbook -i inventory... -vvv Guilherme. On Monday, December 12, 2016 at 4:28:48 PM UTC-2, Reza ISSANY wrote: > > I can't reproduce the same run. Actually, ansible ask me to provide a > password to connect. I

[ansible-project] Conditional when any of several tasks has been done

2016-12-12 Thread John Oliver
Let's say I have a playbook that looks for and changes lines in sshd_config if necessary. Then I want the sshd service to be restarted only if at least one of those actions has taken place. Is there a way to evaluate for that without registering a variable for the completion of each and every

[ansible-project] Re: Tasks are not executed in the order defined in With_dict

2016-12-12 Thread Anand Buddhdev
Hello Deepa, Dictionaries are *not* ordered collections. You should never rely on items in a dictionary to be returned in order. You'd be better off using a list. patches: - patchdata1 - patchdata2 A list preserves order. On Monday, 12 December 2016 15:37:22 UTC+1, Deepa Yr wrote: > > Hi > >

Re: [ansible-project] Re: ansible wait_for ssh for a specific user

2016-12-12 Thread Reza ISSANY
I can't reproduce the same run. Actually, ansible ask me to provide a password to connect. I don't know why. Ansible has to wait until he can connect using the command I provide no ? 2016-12-12 19:23:31,939 p=12608 u=deploy | Using ansible.cfg as config file 2016-12-12 19:23:32,048 p=12608

[ansible-project] ElastiCache error in Ec2.py while running playbooks

2016-12-12 Thread Abhilash Panickar
Hi, For the past few days I am getting the following error when running ansible playbooks using the AWS cloud modules or when directly running the ec2.py file with the --refresh-cache command from my local machine: ap:~ ap$ /ansible/inventory/ec2.py --refresh-cache Traceback (most recent call

Re: [ansible-project] How can I change the path for specific host

2016-12-12 Thread Guilherme Ueno
Hi Dick, Thank you for your attention, but what you mean when you says "host var"? INVENTORY: [webserver] hosta hostb TASK1: - name: copy script to server A copy: src=jboss.sh dest=/usr/app/abc/dir mode=u+rwx TASK2: - name: copy script to server B copy: src=jboss.sh dest=/usr/app/def/dir

[ansible-project] unarchive remote_src not working, no effect

2016-12-12 Thread Spike Robinson
the *copy *option in the *unarchive *module is deprecated and we are advised to use *remote_src* instead However, in an otherwise identical script, having staged the source file to the target machine successfully in a previous play, if I use *copy = no* the play succeeds, but if instead of

[ansible-project] Re: Manipulating EC2 instance storage

2016-12-12 Thread BostonMoto
I discovered volume_size is also optional when using ephemeral option here, it will default to the maximum size of the instance type spec. On Thursday, August 21, 2014 at 9:01:49 AM UTC-4, Mike Buzzetti wrote: > > I just came across this. > > I did something like this for a c3.xlarge. Setting

[ansible-project] Re: Manipulating EC2 instance storage

2016-12-12 Thread BostonMoto
I discovered you volume_size is also optional when using ephemeral option here, it will default to the maximum size of the instance type spec. On Thursday, August 21, 2014 at 9:01:49 AM UTC-4, Mike Buzzetti wrote: > > I just came across this. > > I did something like this for a c3.xlarge.

[ansible-project] ansible ssh error Unreachable.

2016-12-12 Thread Spike Robinson
Basically, debug this using the ping module and an adhoc command eg ansible -m ping xx.whatever and only go back to your playbook once that's working OK. (Apologies for the multiple posts.) -- You received this message because you are subscribed to the Google Groups "Ansible Project"

[ansible-project] ansible ssh error Unreachable.

2016-12-12 Thread Spike Robinson
I'm assuming you have set xx. to the name of a real server and "myname" to a real account on that server, right? :-) -- 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

[ansible-project] ansible ssh error Unreachable.

2016-12-12 Thread Spike Robinson
Often a credentials failure or naming failure rather than connectivity. Check you can manually ssh to the target machine with the host name and username exactly as stated in your hosts file. And remove ssh pipelining to test if that's the issue. -- You received this message because you are

Re: [ansible-project] How can I change the path for specific host

2016-12-12 Thread Dick Davies
If they're in different groups, make the path a group var. If they're in the same groups, make the path a host var. On 12 December 2016 at 14:29, Guilherme Ueno wrote: > Hi all, > > I have to copy a file into a directory to specific hosts, but the path > changes for

Re: [ansible-project] Re: ansible wait_for ssh for a specific user

2016-12-12 Thread Guilherme Ueno
Reza, Could you run with -vvv at the end? Thanks, Guilherme. On Monday, December 12, 2016 at 1:25:56 PM UTC-2, Reza ISSANY wrote: > > yess I've already tried shell butsame issue. If I try to connect > manually, it works. The problem is that ansible doesn't release the > first connection

Re: [ansible-project] Re: Creating Security Groups with EC2_group mod

2016-12-12 Thread DG
I was thinking about possibly using vars in the yaml to deduce what the prefix list actually is. Like, if it's possible to do a var where pl-123456 can be deduced by describing it in AWS cli, then substituting it in. Thanks for the response, now I don't feel like a small island :) Daniel

Re: [ansible-project] Re: ansible wait_for ssh for a specific user

2016-12-12 Thread Reza ISSANY
yess I've already tried shell butsame issue. If I try to connect manually, it works. The problem is that ansible doesn't release the first connection attemps while the server isn't ready. I don't know why ... 2016-12-12 13:58 UTC+01:00, Guilherme Ueno : > Hi, > > Did you

[ansible-project] ansible ssh unreachable

2016-12-12 Thread Raj Reddy
UNREACHABLE! changed : false , msg:SSH error:data could not be sent to the remote host. Make sure this host can be reached over ssh", "unreachable": true Hosts: [test] xx.local ansible_ssh_user=myname ansible.cfg [defaults] host_key_checking = False [ssh_connection] pipelining=true

[ansible-project] How can I change the path for specific host

2016-12-12 Thread Guilherme Ueno
Hi all, I have to copy a file into a directory to specific hosts, but the path changes for specific hosts. Ex.: Inventory: [webserver] hosta hostb task: Copy a file into: hosta: /usr/app/abc/dir hostb: /usr/app/def/dir But, I don't know how to use those variables in the "same task"

[ansible-project] "validate_certs" arg with ansible 2.2 and vmware module not skipping cert validation

2016-12-12 Thread broncomz1
I've see several discussions where the "validate_certs" arg should work (was fixed, https://github.com/ansible/ansible-modules-extras/issues/2757 for example) in order to use self-signed certificates and skip cert validation in ansible 2.2, however I'm still seeing certificate issues when

[ansible-project] [help]Shared connection is closed

2016-12-12 Thread Margin Hu
Hi Guys, I met a strange issue "shared connection closed", googled but don't find any solution or workaround. when the issue happened , the network is ok , why ssh connection closed ? My verion is as following. [root@director ~]# ansible --version ansible 1.9.4 configured module search

[ansible-project] Failed to get D-Bus connection in Docker Container

2016-12-12 Thread Coolman
Hello there, I get the error described in the title when I execute systemctl in a docker container launcher with Ansible docker module. Thus, I cannot manage services in the docker container (eg. satrt/stop/reload nginx service ...etc.) How can I avoid this issue when launching a docker

Re: [ansible-project] Re: Ansible philosophy for those new to the list == keep it simple

2016-12-12 Thread Spike Robinson
I'm kind of with BitDivine. I've been using Ansible "in anger" (at times literally!) on a real world environment for a few months now. I also try to make my playbooks a statement of desired state. Most of the time that's easy to achieve. It gets frustrating when it's not so easy to achieve, but

[ansible-project] ansible ssh error Unreachable.

2016-12-12 Thread Raj Reddy
ERROR: UNREACHABLE! => changed : false , msg:SSH error:data could not be sent to the remote host.Make sure this host can be reached over ssh", "unreachable": true Hosts: [test] xx.local ansible_ssh_user=myname ansible.cfg [defaults] host_key_checking = False [ssh_connection]

[ansible-project] auto-mux: Trying existing master

2016-12-12 Thread Margin Hu
I met a issue when run a playbook. what caused that symtom ? [root@director restart-service-overcloud]# vim site.yml [root@director restart-service-overcloud]# ansible-playbook site.yml PLAY [controllers] GATHERING FACTS

Re: [ansible-project] when ... is defined not woring as expected?

2016-12-12 Thread Kai
Hi Brian, thanks a lot for the pointer / the solution. A double-default does the trick in this case :) with_items: "{{ (pkg_repo_list|default({})).repo_keys | default([]) }}" Cheers, Kai On 12/12/16 15:23, Brian Coca wrote: > when executes for each item in the loop and cannot short circuit

[ansible-project] Tasks are not executed in the order defined in With_dict

2016-12-12 Thread Deepa Yr
Hi I have a dict where I need to install patches in the order patches: patch1: patch_name: patch2: patch_name: patch3: patch_name: and so on patch8: patch_name: - name: install patches include: install_patch.yml with_dict:

[ansible-project] Re: Creating Security Groups with EC2_group mod

2016-12-12 Thread Josh Smift
This came up about a year ago on the ansible-devel list, https://groups.google.com/forum/#!searchin/ansible-devel/prefix$20list%7Csort:relevance/ansible-devel/YjfcFY75wJk/qXoEDQbrEwAJ is the thread: I'd asked about it, someone replied "yes but it'd be tricky", I don't think anything's happened

[ansible-project] when ... is defined not woring as expected?

2016-12-12 Thread Kai
Hi there! ansible-playbook (v. 2.2.0.0) throws an error message that I do not understand in my conext: "'pkg_repo_list' is undefined" The task reads: - name: ensure defined apt keys apt_key: state: present id: "{{pkg_item.id}}"

[ansible-project] Re: How to handle passwords with the vault

2016-12-12 Thread 'J Hawkesworth' via Ansible Project
I think the think you are missing here is that whatever is in group_vars (either a file or a directory) needs to match up with the name of a group in your inventory file (unless you using the magic 'all' group, which applies to all hosts). So you might wind up with 3 files in different

Re: [ansible-project] update of ansible seems to be inconsistent

2016-12-12 Thread Gildas Cotomale
Le jeudi 8 décembre 2016 09:02:31 UTC+1, Andreas Olsson a écrit : > > ons 2016-12-07 klockan 23:40 -0800 skrev Sebastian S.: > > which ansible says: /usr/local/bin/ansible > > That looks more like somewhere where Pip would install Ansible, or > where someone would install Ansible manually. Any

Re: [ansible-project] update of ansible seems to be inconsistent

2016-12-12 Thread Sebastian S.
You were right. There was a ansible pip installation. I uninstalled it and ansible --version is now correct. Thank you!! ^^ Am Donnerstag, 8. Dezember 2016 13:44:35 UTC+1 schrieb Sebastian S.: > > In fact there is one. But when I run this one something goes wrong: > > ansible@DE9899S76

[ansible-project] Re: Creating Security Groups with EC2_group mod

2016-12-12 Thread Dan
Has anyone found a method around this? On Friday, December 9, 2016 at 5:57:09 PM UTC-5, Dan wrote: > > I've had great success in building out my security groups with this > module, until today. > > The issue is that I cannot code in yaml a destination referencing a > prefix-list. "pl-XX" >

[ansible-project] ansible wait_for ssh for a specific user

2016-12-12 Thread zerros
Hi, forgive me for my bad english. I'm trying to find a way to test an ssh connection to a specific user on a new server. When I create a new virtual server, an ansible playbook is executed to finish the soft deployments: 1 Check if ssh is available (port 22) 2 Chekc if the ansible user is

Re: [ansible-project] Re: Ansible philosophy for those new to the list == keep it simple

2016-12-12 Thread Bit Divine
Do you feel safe running the playbook automatically every five minutes and having it alert you when things were not as expected? Personally that's the point I'd feel queasy about, and given that a playbook (in my philosophy) logically must have a check only mode, not as a feature but as