[ansible-project] VARIABLE IS NOT DEFINED!

2018-01-19 Thread Surjeet Singh
am i impacted with some bug ? "VARIABLE IS NOT DEFINED!" root@eve-ng:/etc/ansible# ansible-playbook test.yaml PLAY [collect device facts and display OS version] ** TASK [run the show

Re: [ansible-project] json_query on getent_group-data: resolving the group-name for a given group-id

2018-01-19 Thread Henning Rohde
Hello Kai Stian, thank you to have a look into this! Am Donnerstag, 18. Januar 2018 15:17:02 UTC+1 schrieb Kai Stian Olstad: > > - debug: > msg: '{% for k, v in getent_group.iteritems() %}{% if v.1 == "1000" > %}{{ k }}{% endif %}{% endfor %}' > Whow! This works! - debug:

Re: [ansible-project] Re: include_tasks with tags, regression of feature?

2018-01-19 Thread Matt Martz
As you have discovered, you will need to use the `block` method if you want to "easily" apply a tag or set of tags to a group of tasks without tagging each one individually. Attributes applied to a dynamic include (include_*) apply to the include and not to the tasks within. This is the primary

Re: [ansible-project] Re: include_tasks with tags, regression of feature?

2018-01-19 Thread Mike Klebolt
I won't be able to use 2.5 since import_tasks with a dynamically assigned variable with fail. Is there a way around this? --- - name: Test hosts: localhost gather_facts: False connection: local tasks: - set_fact: dynamic_variable: dynamic - import_tasks: "{{ dynamic_variable

Re: [ansible-project] Re: include_tasks with tags, regression of feature?

2018-01-19 Thread Matt Martz
The explanation listed at https://github.com/ansible/ansible/issues/35065#issuecomment-358998670 should hopefully answer your questions. If you want an attribute to be inherited on the tasks, you should use `import_tasks` as opposed to `include_tasks`. Attributes on `include_tasks` should apply

[ansible-project] Re: include_tasks with tags, regression of feature?

2018-01-19 Thread Mike Klebolt
I've also tried wrapping all the tasks in the dynamically included file in a block and adding a tag to the block. This achieves what I'm trying to accomplish but doesn't feel like the proper approach. On Friday, January 19, 2018 at 9:58:05 AM UTC-6, Mike Klebolt wrote: > > I'm trying to

[ansible-project] include_tasks with tags, regression of feature?

2018-01-19 Thread Mike Klebolt
I'm trying to dynamically include tasks along with using tags. The issue I'm running into is that yes, its including the tasks file, but its not executing any of the tasks within that file. After reading the Creating Reusable Playbooks guide, it appears this is by design for include_tasks.

Re: [ansible-project] How to resolve this error ""msg": "the field 'args' has an invalid value ([]), and could not be converted to an dict.The error was: Extra data: line 2 column 1 - line 2 column 31

2018-01-19 Thread Matt Martz
You may be suffering from a limitation of the key=value syntax and how templating is performed. When used with data like JSON that will return spaces, and when surrounding the value with double quotes, it will allow the resultant value, to break out of the assignment to the specified variable.

[ansible-project] Re: Tasks in rescue don't work if host is unreachable

2018-01-19 Thread Graham Dougan
Hi Vlad, Struggling with the same issue, did you get anywhere with it? Thanks, Graham On Sunday, March 19, 2017 at 10:29:48 PM UTC, kaufma...@gmail.com wrote: > > Hello everyone, > > For error handling I'm trying to use "block - rescue". I looked im > internet and found out that rescue doesn't

[ansible-project] “Invalid credentials Error” in Ansible win_share when we create the File share permission by using our domain account after running the domain joining script

2018-01-19 Thread edwinkamal
0down votefavorite I create AWS app server using ansible script and install the software using temp username and password in winrm host file.After setup I run the

[ansible-project] Re: Tasks in rescue don't work if host is unreachable

2018-01-19 Thread Graham Dougan
Hi Vlad, Struggling with the same issue, did you get anywhere with it? Thanks, Graham On Sunday, March 19, 2017 at 10:29:48 PM UTC, kaufma...@gmail.com wrote: > > Hello everyone, > > For error handling I'm trying to use "block - rescue". I looked im > internet and found out that rescue doesn't

[ansible-project] Re: Install Docker on Windows Server 2016 using win_shell module

2018-01-19 Thread Larry Smith
Awesome. Glad you got it sorted out. On Friday, January 19, 2018 at 3:02:54 AM UTC-5, Andreas Mosti wrote: > > I got it working from the powershell-module with the following tasks: > > - name: Enable Windows Container Feature > win_feature: > name: Containers > state: present >

[ansible-project] getting facts from remote devices

2018-01-19 Thread Surjeet Singh
Hi, I am new to this community and new ansible as so please excuse me of my stupid mistakes. referring to peter's webinar i am trying to collect device information using reguler expressions.it seems it through me error as bellow:- TASK [network_facts : set hostname fact]

[ansible-project] Re: Install Docker on Windows Server 2016 using win_shell module

2018-01-19 Thread Andreas Mosti
I got it working from the powershell-module with the following tasks: - name: Enable Windows Container Feature win_feature: name: Containers state: present register: dockerwindowsfeature - name: Reboot server if Windows Container Feature requires it win_reboot: