[ansible-project] Problem with include_tasks

2017-09-21 Thread Jürgen Haas
I have a lot of includes in my roles and I replaced them with include_tasks which seems to be working fine. Just for one instance there is a problem. The original task in that role looks like this: ``` - name: "Install Drupal" include: install.yml with_items: '{{ drupal_settings }}' ```

[ansible-project] Role dependencies across multiple plays

2013-12-05 Thread Jürgen Haas
According to the documentation, role dependencies would no longer run more than once, unless the setting allow_duplicates: yes was used. I assume that is if a role is included more than once with the same play. In my scenario a role called common is included from almost every other role and hen

[ansible-project] Lookup plugins and async tasks

2013-12-05 Thread Jürgen Haas
Some of my subversion checkout tasks take really long and I do not have to wait for them. So I thought async with no polling would do the job. Unfortunately, the definition of my subversion tasks is in a hash and so I wanted to use with_items but then I learned that those can't be combined. The

Re: [ansible-project] Lookup plugins and async tasks

2013-12-05 Thread Jürgen Haas
n? > > -- Michael > > On Dec 5, 2013, at 1:28 PM, "Jürgen Haas" > > wrote: > > Some of my subversion checkout tasks take really long and I do not have to > wait for them. So I thought async with no polling would do the job. > Unfortunately, the definiti

[ansible-project] Re: Role dependencies across multiple plays

2013-12-05 Thread Jürgen Haas
an ideal > solution. I'd be interested in a better answer for this as well. > > Nathan > > On Thursday, 5 December 2013 07:40:28 UTC-8, Jürgen Haas wrote: >> >> According to the documentation, role dependencies would no longer run >> more than once, unless th

[ansible-project] Looking for ideas: secure user management

2013-12-08 Thread Jürgen Haas
Let's assume we have any array of users that should be present on any host with some defined permissions. To do that with ansible, the modules 'user' and 'authorized_key' are perfect tools. What I would like to achieve in addition is to make sure that no other user accounts are available on my

Re: [ansible-project] Looking for ideas: secure user management

2013-12-09 Thread Jürgen Haas
Using cat /etc/passwd | perl -ane -F: 'print $F[0],"\n" if $F[2] > 499' Generates the following error message: Warning: Use of "-F" without parentheses is ambiguous at -e line 1. syntax error at -e line 1, near "F:" Execution of -e aborted due to compilation errors. Am Sonntag, 8. Dezember 201

Re: [ansible-project] Looking for ideas: secure user management

2013-12-10 Thread Jürgen Haas
Great, that works. And with $F[5] we also get the home directory for each user. So I'll see if I can turn that into a default playbook for general us as Michael DeHaan suggested. Am Montag, 9. Dezember 2013 21:31:32 UTC+1 schrieb Kahlil Hodgson: > > On 9 December 2013 19:51,

Re: [ansible-project] Looking for ideas: secure user management

2013-12-10 Thread Jürgen Haas
further enhance that role so that it is going to become the full user management role including the creation of user accounts and management of ssh keys plus many more ideas hopefully to come. Am Dienstag, 10. Dezember 2013 10:22:06 UTC+1 schrieb Jürgen Haas: > > Great, that works. And with

Re: [ansible-project] Looking for ideas: secure user management

2013-12-11 Thread Jürgen Haas
;All parts should go together without forcing. You must remember that > the parts you are reassembling were disassembled by you. Therefore, > if you can't get them together again, there must be a reason. By all > means, do not use a hammer." -- IBM maintenance manual, 1925 >

[ansible-project] Re: duplicated role execution..

2013-12-11 Thread Jürgen Haas
You may want to have a look here: https://groups.google.com/d/msg/ansible-project/nd4wMLsb0Jw/7-svzpNpTIQJ Nathan Howell has demonstrated a very nice approach which works very nice for me. Am Mittwoch, 11. Dezember 2013 06:20:00 UTC+1 schrieb Xu Chen: > > I have defined three roles: A, B and C.

[ansible-project] Problem with key_options

2014-01-02 Thread Jürgen Haas
Looks like Ansible 1.4.x behaves different form earlier versions with key_options in the module authorized_key. The following task resulted in a proper line in the authorized_keys file but does no longer (tested with 1.4.1 and 1.4.3): - name: 'Subversion | Install SSH user public keys' author

Re: [ansible-project] Problem with key_options

2014-01-03 Thread Jürgen Haas
es. > > On Jan 2, 2014, at 9:30 AM, Jürgen Haas > > wrote: > > Looks like Ansible 1.4.x behaves different form earlier versions with > key_options in the module authorized_key. The following task resulted in a > proper line in the authorized_keys file but does no

Re: [ansible-project] Problem with key_options

2014-01-03 Thread Jürgen Haas
ed key file > as well as what keys you are adding, or steps from your playbook. > > > > > On Fri, Jan 3, 2014 at 3:24 AM, Jürgen Haas > > wrote: > >> Just tried the latest dev release with the exact same result. So it still >> doesn't seem to be workin

[ansible-project] Re: Best approach to add or remove users to match list

2014-01-14 Thread Jürgen Haas
I have the similar requirement and started working on a role called user management. It is available from https://galaxy.ansibleworks.com/list#/roles/22 but it is far from complete. As a proof-of-concept it currently deals with user-accounts that should be removed (or locked / disabled) if they

[ansible-project] Drupal or Drush users in the house?

2014-01-24 Thread Jürgen Haas
If you're interested in a Drush module for Ansible, please look here: https://groups.google.com/d/msg/ansible-devel/WTY9rl-0UkA/tvZsBoqh2NcJ -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving em

[ansible-project] Re: [ansible-devel] Start of a coding guidelines document

2014-02-10 Thread Jürgen Haas
Ouch Am Freitag, 7. Februar 2014 17:04:02 UTC+1 schrieb Michael DeHaan: > > This is not up for debate. > > > On Fri, Feb 7, 2014 at 10:24 AM, Jakub Warmuz > > > wrote: > >> On 26.01.2014 22:06, Michael DeHaan wrote: >> > https://github.com/ansible/ansible/blob/devel/CODING_GUIDELINES.md >> > >>

Re: [ansible-project] frustrated

2014-03-03 Thread Jürgen Haas
I came across something similar in version 1.5 and found the following in /usr/local/bin/ansible: ``` if options.su_user or options.ask_su_pass: options.su = True ``` As the default for su_user is roolt, the above is always valid and options.su gets always set to True. Even i

[ansible-project] How to execute a task only if a list of hosts haven't failed yet

2014-03-28 Thread Jürgen Haas
In out common role we have a task which creates a script from a template to create ssh tunnel between a certain number of hosts in the inventory. The template looks like this: {% for host in ssh_tunnel %} {% if host != inventory_hostname %} {% if hostvars[host]['ansible_default_ipv4'] is defined

Re: [ansible-project] ansible 2 ping failure

2016-01-14 Thread Jürgen Haas
I'm having a similar issue: $ ansible -i inventory crcweb -m ping -vvv Using /home/jurgenhaas/.ansible.cfg as config file ESTABLISH SSH CONNECTION FOR USER: jurgenhaas SSH: EXEC ssh -C -q -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o KbdInteractiveAuthentication=no

Re: [ansible-project] ansible 2 ping failure

2016-01-14 Thread Jürgen Haas
Reported at GitHub: https://github.com/ansible/ansible/issues/13882 Am Donnerstag, 14. Januar 2016 10:35:05 UTC+1 schrieb Jürgen Haas: > > I'm having a similar issue: > > $ ansible -i inventory crcweb -m ping -vvv > Using /home/jurgenhaas/.ansible.cfg as config file > E

[ansible-project] Simple task breaks with version 2.0.2.0

2016-04-20 Thread Jürgen Haas
The task is this: - name: "Check Ansible version" run_once: true debug: msg="You need at least version 2.0.0.0, currently using version {{ ansible_version.full }}" failed_when: "{{ ansible_version.full | version_compare('2.0.0.0', operator='lt', strict=False)}}" The error message doesn't

Re: [ansible-project] Simple task breaks with version 2.0.2.0

2016-04-20 Thread Jürgen Haas
Well, when I do failed_when: ansible_version.full | version_compare('2.0.0.0', operator='lt', strict=False) I'll get this error: The error was: template error while templating string: unexpected '}', expected ')'. String: {% if ansible_version.full|version_compare('2.0.0.0' %} True {% else %}

Re: [ansible-project] Simple task breaks with version 2.0.2.0

2016-04-21 Thread Jürgen Haas
Also, I'd suggest to update the documentation at http://docs.ansible.com/ansible/playbooks_filters.html#version-comparison-filters about this too, because this is where I got it from. Am Donnerstag, 21. April 2016 08:50:43 UTC+2 schrieb Jürgen Haas: > > Well, when I do >

Re: [ansible-project] Simple task breaks with version 2.0.2.0

2016-04-24 Thread Jürgen Haas
Has anyone else had this issue as well? Looks to be that version_compare() is completely broken. @Brian, what about the follow up issue when removing some of the wrappers like suggested? Am Donnerstag, 21. April 2016 09:16:17 UTC+2 schrieb Jürgen Haas: > > Also, I'd suggest to

Re: [ansible-project] Simple task breaks with version 2.0.2.0

2016-04-25 Thread Jürgen Haas
Also reported this in the issue queue: https://github.com/ansible/ansible/issues/15572 Looks like there is a broader issue. Am Montag, 25. April 2016 08:21:30 UTC+2 schrieb Jürgen Haas: > > Has anyone else had this issue as well? Looks to be that version_compare() > is complete

[ansible-project] Shell command with problems since 2.0.2.0

2016-04-26 Thread Jürgen Haas
My task calls this shell: free | awk '/Mem:/ {print $4}' and the output is empty. Up until Version 2.0.1.0 this correctly output the 4th string of the second line from the free command. When changing that to shell: echo "free | awk '/Mem:/ {print $4}'" > /tmp/output we get free | awk '/Mem:

[ansible-project] Re: Shell command with problems since 2.0.2.0

2016-04-26 Thread Jürgen Haas
ed in version 2.0.2.0? Q4: How can I change that to the previous behaviour? Am Mittwoch, 27. April 2016 08:15:31 UTC+2 schrieb Jürgen Haas: > > My task calls this > > shell: free | awk '/Mem:/ {print $4}' > > > and the output is empty. Up until Version 2.0.1.0 this corre

[ansible-project] Re: Shell command with problems since 2.0.2.0

2016-04-27 Thread Jürgen Haas
> > Edgars > > > trešdiena, 2016. gada 27. aprīlis 08:15:31 UTC+2, Jürgen Haas rakstīja: >> >> My task calls this >> >> shell: free | awk '/Mem:/ {print $4}' >> >> >> and the output is empty. Up until Version 2.0.1.0 this correctly

[ansible-project] Re: Shell command with problems since 2.0.2.0

2016-04-27 Thread Jürgen Haas
8 LC_ALL=en_GB.UTF-8 LC_MESSAGES=en_GB.UTF-8 > > Perhaps you can change it in your ansible.cfg like > https://docs.ansible.com/ansible/intro_configuration.html#module-lang > > module_lang = en_US.UTF-8 > > Edgars > > > > trešdiena, 2016. gada 27. aprīlis 08:15:31

[ansible-project] Force to gather fact even if gathering is set to smart

2016-04-29 Thread Jürgen Haas
How can I force setup to run on a play even if the Ansible config file is set to gathering strategy of smart. When I include gather_facts: True for a play, it is just ignored while the facts file for a host is available in ~/.ansible/facts - this is in Ansible version 2.0.2.0 What am I doing

[ansible-project] Problem with mysql core modules when host and/or port are non default

2016-05-05 Thread Jürgen Haas
According to the docs, Ansible started to support the config file (default: ~/.my.cnf) when connecting to the MySQL database and it reads the username and password from that file to be used when the arguments for login_user and login_password are not provided. However, the same should be the ca

[ansible-project] Git module: How to provide a config setting when cloning a repository

2016-10-31 Thread Jürgen Haas
I wonder if it's possible to provide some config values when initially cloning a repository. The command line would look like this: git clone -b 2.17.0 --recurse-submodules --config filter.lfs.smudge=true https://github.com/piwik/piwik.git Using the git_config module doesn't seem to be an optio

[ansible-project] Re: lineinfile single quotes in regexp

2016-11-15 Thread Jürgen Haas
Had the same problem not long ago. Escaping here works with doubling the single quote. Am Dienstag, 15. November 2016 16:29:47 UTC+1 schrieb Dader Grund: > > hallo, > > i need to uncomment this statement : > ># 'Mirroring', > > in gitolite.rc . > > The problem is that 'Mirroring' contains qu

[ansible-project] Timeout problem with far distance host

2017-02-26 Thread Jürgen Haas
This has been discussed at many places but this scenario is certainly different. Within my repository I do have one host which is on mainland China, i.e. inside the great firewall. And therefore the connection is significantly slower than anything else. My playbooks do work most of the time, bu

Re: [ansible-project] Timeout problem with far distance host

2017-03-05 Thread Jürgen Haas
Here is what I've added to the host vars for that particular host: ``` ansible_ssh_args: -o ConnectTimeout=240s -o ControlMaster=auto -o ControlPersist=60s -o ForwardAgent=yes ``` Unfortunately that didn't help. The connection timeout setting is new to this host, the other values are the

Re: [ansible-project] Timeout problem with far distance host

2017-03-07 Thread Jürgen Haas
That's strange, it doesn't use those settings although they are in the inventory for that host: Using module file /usr/lib/python2.7/dist-packages/ansible/modules/core/ system/setup.py ESTABLISH SSH CONNECTION FOR USER: jurgenhaas SSH: EXEC ssh -vvv -o ControlMaster=auto -o ControlPersist=60s -

Re: [ansible-project] Timeout problem with far distance host

2017-03-07 Thread Jürgen Haas
OK, that certainly makes a difference. The output of - is now as expected and I'll deploy that to may infrastructure and will watch the behavior the next couple of days, if that stabilizes the operations on that host. Thanks Brian for your help. Am Dienstag, 7. März 2017 18:48:46 UTC+1 sch

Re: [ansible-project] Timeout problem with far distance host

2017-03-11 Thread Jürgen Haas
quot;'"'"' && sleep 0'"'"'' fatal: [fimfcn1]: FAILED! => { "failed": true, "msg": "Timeout (12s) waiting for privilege escalation prompt: " } Any other idea I could go about? That error comes