Re: [ansible-project] BUG? 'AnsibleSequence' object has no attribute 'strip'

2018-02-13 Thread Kai Stian Olstad
On 14.02.2018 00:30, John Harmon wrote: I don't know if I have a syntax issue or a bug. Thought before filing a bug I would see what you guys thought. I have a bunch of roles/playbooks I wish to execute against new servers. Here is what I have come up with. ansible-2.4.3.0-1.el7.ans.noarch

[ansible-project] Re: Yaml statement over multiple lines.

2018-02-13 Thread flowerysong
On Tuesday, February 13, 2018 at 7:25:24 AM UTC-5, mail.ph...@gmail.com wrote: > > > How should I split this dest: statement into multiple lines ? > > - copy: > content: "{{ config.stdout[0] }}" > *dest: "{{ backup_root }}/{{ inventory_hostname }}/dhcp_leases_{{ >

[ansible-project] Re: do_dictsort() got an unexpected keyword argument 'reverse'

2018-02-13 Thread Martin Cigorraga
Matt, I can't share the details as it wasn't me the one who made the implementation, but we were able to adapt the Jinja2 2.10 filter plugin by converting it to an Ansible v2 filter plugin. Cheers -- You received this message because you are subscribed to the Google Groups "Ansible Project"

[ansible-project] Re: BUG? 'AnsibleSequence' object has no attribute 'strip'

2018-02-13 Thread John Harmon
If I comment out the import_playbook: section down, it works so the issue is in the latter-half still trying to narrow down -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails

[ansible-project] BUG? 'AnsibleSequence' object has no attribute 'strip'

2018-02-13 Thread John Harmon
I don't know if I have a syntax issue or a bug. Thought before filing a bug I would see what you guys thought. I have a bunch of roles/playbooks I wish to execute against new servers. Here is what I have come up with. ansible-2.4.3.0-1.el7.ans.noarch Playbook: --- - hosts: "{{ host }}"

[ansible-project] letsencrypt module - account_key

2018-02-13 Thread Michael Bubb
Hello - I am a little confused by what is needed in the account_key parameter. The docs say it is: *File containing the Let's Encrypt account RSA key.* *Can be created with openssl rsa * I know when I first setup the account it generated keys in /etc/letsencrypt/accounts/... They are in a

[ansible-project] Re: Looping over nested inventory items with conditional

2018-02-13 Thread flowerysong
On Tuesday, February 13, 2018 at 4:02:57 PM UTC-5, Jason Gilfoil wrote: > > > We're migrating from a single load balancer pair for all systems > (dev/test/qa/prod) to separate pairs for dev/test and qa/prod. As a result, > my previous task to pull nodes from the pool on the load balancer will no

Re: [ansible-project] jinja help

2018-02-13 Thread Kai Stian Olstad
On Tuesday, 13 February 2018 20.01.05 CET John Harmon wrote: > Is there a good place to find out what I can/can't do for this kind of > stuff (maybe even just a cheat sheet)? I don't know anything about jinja > and don't know the best place to start. Also, how would you change the > above to

[ansible-project] Looping over nested inventory items with conditional

2018-02-13 Thread Jason Gilfoil
Hey all, We're migrating from a single load balancer pair for all systems (dev/test/qa/prod) to separate pairs for dev/test and qa/prod. As a result, my previous task to pull nodes from the pool on the load balancer will no longer suffice without some conditional logic. I have a partial

[ansible-project] Re: How to get processeur vendor ?

2018-02-13 Thread Eric Secrist
Hi Flow, Did you ever get an answer to your question. I see a different number of list values for ansible_processor between two hosts, which makes it difficult to easily gather the processor vendor across many hosts. ok: [host1] => { "hostvars[inventory_hostname].ansible_processor": [

[ansible-project] Re: jinja help

2018-02-13 Thread John Harmon
Thanks Jason. I also found that this works too: when: not(ansible_hostname | lower | search ("sql-db")) On Tuesday, February 13, 2018 at 1:25:37 PM UTC-7, Jason Gilfoil wrote: > > Not sure about your second question, but as for your first, this should > work. > > when: ansible_hostname |

[ansible-project] Re: jinja help

2018-02-13 Thread Jason Gilfoil
Not sure about your second question, but as for your first, this should work. when: ansible_hostname | lower | search ("sql-db") == False No idea where I found it originally, i just dug through my own scripts for an example. On Tuesday, February 13, 2018 at 2:01:05 PM UTC-5, John Harmon

[ansible-project] Connecting to Windows hosts in EC2 using Kerberos (Tower) (maybe not what you think)

2018-02-13 Thread travisk
Hello! Currently in Tower we have dynamic inventory set up to pull in data about EC2 instances from our AWS account. We have vpc_destination_variable set to internal IPs since we connect to EC2 via Direct Connect. After a lot of work, I have Kerberos working with my Windows hosts! However, my

[ansible-project] Re: Using 2 inventories. Can someone explain what I'm doing wrong?

2018-02-13 Thread Varun Chopra
Thanks. I read your post and realized what I did wrong. /workspace was my working directory and workstation's my hostname. Mixed up the two. :l On Tuesday, February 13, 2018 at 11:08:42 PM UTC+5:30, Vyacheslav wrote: > > > > Missing (or not readable) key file: '/workstation/gcloud/ >

[ansible-project] jinja help

2018-02-13 Thread John Harmon
I need to take this and do the opposite: when: ansible_hostname | lower | search ("sql-db") ie: when: not(ansible_hostname | lower | search ("ebs-db")) Is there a good place to find out what I can/can't do for this kind of stuff (maybe even just a cheat sheet)? I don't know anything about

[ansible-project] library/module_utils functionality question

2018-02-13 Thread Arthur Reyes
Follow-up. I tested copying a module from core into the playbook library. Modifying the content, without altering the module name and observed that ansible.library picked up the local module first. -- You received this message because you are subscribed to the Google Groups "Ansible Project"

[ansible-project] Re: Using 2 inventories. Can someone explain what I'm doing wrong?

2018-02-13 Thread Vyacheslav
> Missing (or not readable) key file: '/workstation/gcloud/ credentials.json' what says ls -la /workstation/gcloud | grep credentials.json ? On Tuesday, 13 February 2018 17:06:35 UTC+1, Varun Chopra wrote: > > So I plan to use a static and a dynamic inventory (gce) and this is what > my play

Re: [ansible-project] Ansible Module Documentation

2018-02-13 Thread Brian Coca
You might just want to use ansible-doc to verify the docs are correct, that does not require any downloading. You only require the full repo if you actually want an HTML version. -- Brian Coca -- You received this message because you are subscribed to the Google Groups "Ansible

[ansible-project] Re: What's the safest way to do grep-like searches in files?

2018-02-13 Thread Arthur Reyes
Not knowing the state of your environment or what you intend to do with the registered fact, I can only offer you this advice: If a line in a file needs to exist and an action should occur if that file is changed, line in file is the most precise way to do this operation. If you are using

Re: [ansible-project] Re: What's the safest way to do grep-like searches in files?

2018-02-13 Thread Brian Coca
The find module has a 'contains' option. -- -- 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] Re: What's the safest way to do grep-like searches in files?

2018-02-13 Thread Nico Sabbi
That may turn out to be too late depending on the complexity of the R.E. It's not an error-proof approach. Il giorno martedì 13 febbraio 2018 16:48:53 UTC, Arthur Reyes ha scritto: > > You should run your playbook in check mode until you're certain that your > regular expression is precise. > >

Re: [ansible-project] What's the safest way to do grep-like searches in files?

2018-02-13 Thread Nico Sabbi
I like it. Thanks Il giorno martedì 13 febbraio 2018 16:50:44 UTC, Matt Martz ha scritto: > > I would honestly use slurp to fetch the file and maybe a set_fact to set a > var indicating it's existence. That is the pattern I have always used. > Something like: > > - slurp: > path:

Re: [ansible-project] What's the safest way to do grep-like searches in files?

2018-02-13 Thread Matt Martz
I would honestly use slurp to fetch the file and maybe a set_fact to set a var indicating it's existence. That is the pattern I have always used. Something like: - slurp: path: /etc/myfile register: myfile - set_fact: contains_cmdline: "{{ myfile.contents|b64decode|search("^CMDLINE")

[ansible-project] Re: What's the safest way to do grep-like searches in files?

2018-02-13 Thread Arthur Reyes
You should run your playbook in check mode until you're certain that your regular expression is precise. On Tuesday, February 13, 2018 at 10:45:57 AM UTC-6, Nico Sabbi wrote: > > HI, > I need to do a grep-like search in a file without using shell commands and > in a check_mode compatible way. >

[ansible-project] What's the safest way to do grep-like searches in files?

2018-02-13 Thread Nico Sabbi
HI, I need to do a grep-like search in a file without using shell commands and in a check_mode compatible way. I just need to check the presence of a given string a in a file without doing overwrites of any kind. I implemented something with lineinfile but I'm very annoyed by the need to

[ansible-project] library/module_utils functionality question

2018-02-13 Thread Arthur Reyes
If a module with the same name as a core module exists in the ./library or ./module_utils directory of the plabyook, which module will be get invoked when I reference it in my playbook? I have a need to modify the functionality of a core module. I could refactor/rename it to [module]_internal

[ansible-project] Using 2 inventories. Can someone explain what I'm doing wrong?

2018-02-13 Thread Varun Chopra
So I plan to use a static and a dynamic inventory (gce) and this is what my play folder looks like: . ├── ansible.cfg ├── credentials.json ├── gce_vars │ ├── auth │ └── test_servers ├── group_vars │ └── all ├── hosts.yml ├── inventory │ ├── gce.ini │ ├── gce.py │ └── hosts.yml └──

Re: [ansible-project] In a loop everything executes at the same time?

2018-02-13 Thread Guillem Sola
Very interesting, so then each host individually needs 0 sec for the iterations it doesn't execute which ends up with all the hosts executing the tasks at the same time. I was inspired by this comment https://github.com/ansible/ansible/issues/12170#issuecomment-283950548 but now I understand

Re: [ansible-project] Yaml statement over multiple lines.

2018-02-13 Thread Kai Stian Olstad
On Tuesday, 13 February 2018 13.25.24 CET mail.philfri...@gmail.com wrote: > How should I split this dest: statement into multiple lines ? > > - copy: > content: "{{ config.stdout[0] }}" > *dest: "{{ backup_root }}/{{ inventory_hostname }}/dhcp_leases_{{ >

[ansible-project] Yaml statement over multiple lines.

2018-02-13 Thread mail . philfriend
Hi, How should I split this dest: statement into multiple lines ? - copy: content: "{{ config.stdout[0] }}" *dest: "{{ backup_root }}/{{ inventory_hostname }}/dhcp_leases_{{ ansible_date_time.year }}{{ ansible_date_time.month }}{{ ansible_date_time.day }}{{

[ansible-project] Dictionary Parsing

2018-02-13 Thread Mona Gopal
We are trying to write Ansible playbooks for releasing patches for an application In patch releases there are 4 basic changes that can be there We will create 4 roles for those BinaryRole : For changing war files and jar files with backup and replacing the existing configurations

Re: [ansible-project] Dynamic Inventory using Active Directory / LDAP

2018-02-13 Thread Michael Ströder
aa...@klep.net wrote: > Does anyone have code that can pull a dynamic inventory from list of AD > OUs?  Want to use the windows_update module to patch our servers only in > specific OUs. > > Maybe I missed it, but I don't see Windows Active Directory inventory > here: