[ansible-project] Ansible creating a host on zabbix with playbook

2019-08-15 Thread Ari Prince
Hi guys, am testing the zabbix official playbook from ansible site. I've changed all the values with mine, but when run it I get "Failed to connect to Zabbix server: urllib2. URLError - Not Found" Any ideas how fix this? -- You received this message because you are subscribed to the Google

[ansible-project] Ansible 2.8.1: Multiline debug not working with debug output filter

2019-08-15 Thread Andrew Hodgson
Hi all, I am using Ansible 2.8.1 and want to create a multiline debug output at the end of a play run: https://docs.ansible.com/ansible/latest/modules/debug_module.html Suggests this is possible, I am trying the following: - name: Give cluster information debug: msg: -

Re: [ansible-project] How to use Ansible with clients that have dynamic (DHCP) IPs?

2019-08-15 Thread Matt Fahrner
Mean to respond to this earlier. Thank you - yes VPN is a possibility here as well. Thanks again. On Saturday, July 27, 2019 at 6:37:07 PM UTC-4, J wrote: > > You also could use an automatc VPN client and the corresponding IP; this > also works for DHCP Clients that are leaving your network.

[ansible-project] Can inventory plugin "constructed" create a groups based on ansible_facts

2019-08-15 Thread Михаил Политаев
Hello community! A have plenty of EC2 servers in AWS and want to categorize them based on gathered from ansible_facts (by module setup), for example have group "CentOS" where ansible_facts['distribution'] == 'CentOS' and so on. But having file "inventory/constructed.yml": plugin: constructed

Re: [ansible-project] ansible find.py seems to fail on NFS drives with certain mount options

2019-08-15 Thread Larry Kyrala
Thanks Kai, I tried and narrowed down the following: # strace on isdir $ diff nfs_{bad,good}.log 1,2c1,2 < user2 ~> sudo -H strace -f python -c 'import os; print os.path.isdir("nfsdir")' < execve("/usr/bin/python", ["python", "-c", "import os; print os.path.isdir(\""...], [/* 17 vars */]) = 0

[ansible-project] Loop until k8s (lookup/query) module returns a valid value

2019-08-15 Thread Thms Hmm
Ansible Version: 2.8.1 Hi, I'm trying to get the status of a Kubernetes StatefulSet and wait till it has a specific value. The task looks like this: - set_fact: myVar: "{{ query('k8s', host='myhost.local', ... kind='StatefulSet', label_selector='app=test') }}" retries: 5 delay: 30

[ansible-project] Json output

2019-08-15 Thread vinoth kumar
Hi Folks, I need your help here, how can i get all hostnames (marked) to print. when i try msg: "{{results.json.actions[0].system.hostname}}" and msg: "{{results.json.actions[1].system.hostname}}" it prints me the two hosts, but i need all hosts availble in single msg -- tried this --msg:

Re: [ansible-project] ansible find.py seems to fail on NFS drives with certain mount options

2019-08-15 Thread Larry Kyrala
The other user's home directory didn't have execute privileges. Thanks for your help and patience! On Thursday, August 15, 2019 at 2:08:21 PM UTC-4, Larry Kyrala wrote: > > Thanks Kai, I tried and narrowed down the following: > > # strace on isdir > > > $ diff nfs_{bad,good}.log > 1,2c1,2 > <

Re: [ansible-project] Difficulty differencing list with integers vs list with strings.

2019-08-15 Thread gaurav thosani
Auralan, Wondering if jinja2 typecasting could be attempted for your use case Reference: https://stackoverflow.com/questions/39938323/jinja-convert-string-to-integer?rq=1 Gaurav Thosani On Thu, Aug 15, 2019 at 3:09 PM Auralan wrote: > Hi everyone, > > I've been struggling to get the

[ansible-project] Difficulty differencing list with integers vs list with strings.

2019-08-15 Thread Auralan
Hi everyone, I've been struggling to get the difference between 2 lists in Ansible. List 1 contains numbers as integers. List 2 contains numbers as strings. These obviously cannot be filtered with difference(). Does anyone know a workaround? Or a point where I can make a change in my parsing

Re: [ansible-project] Difficulty differencing list with integers vs list with strings.

2019-08-15 Thread Auralan
Hello Gaurav, Thank you for your reply. I should have mentioned that I have previously tried making the int filter work in the "device_list" task. Inserting it just before the list filter, however, doesn't seem to work. It claims to not accept the resulting integer: fatal: [some_switch]:

[ansible-project] Re: Using the magic variable groups

2019-08-15 Thread Harrymosco
Thanks Kai Stian, Absolutely what I want. Fantastic!! All I am doing now is use "--extra-vars" and assign any I want to configure to the variable, and that's it. The code does not need to be modified anymore for different s. Appreciated!! -Harrymosco. On Friday, August 9, 2019 at

[ansible-project] Re: Difficulty differencing list with integers vs list with strings.

2019-08-15 Thread Zolvaring
Would something like this syntax help? set_fact: difference_list: >- {{ numbers_as_integers | difference(numbers_as_strings | map(attribute='whatever_attribute_you_may_need') | map('int') | list }} ^ What that should do for the list of numbers as strings,

[ansible-project] Confused newbie - ERROR! the field 'hosts' is required but was not set

2019-08-15 Thread GM
Hi there - first I will post my response from when I run my playbook: ansible-playbook -vv glen.yml ansible-playbook 2.5.2 config file = /etc/ansible/ansible.cfg configured module search path = [u'/home/gmillard/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules'] ansible

[ansible-project] Re: Difficulty differencing list with integers vs list with strings.

2019-08-15 Thread Zolvaring
On closer examination I dropped a parenthesis entering this in, so for clarity: difference_list: >- {{ numbers_as_integers | difference(numbers_as_strings | map(attribute='whatever_attribute_you_may_need') | map('int') | list) }} On Thursday, August 15, 2019

[ansible-project] Re: Confused newbie - ERROR! the field 'hosts' is required but was not set

2019-08-15 Thread Zolvaring
The problem in this case is just the yaml syntax. "-" denotes the start of a new item, typically in a list, so when you write: - hosts - name You are actually writing two separate objects, when what you want is: - name: "download artifactory" hosts: all On Thursday, August 15, 2019 at

[ansible-project] Re: Confused newbie - ERROR! the field 'hosts' is required but was not set

2019-08-15 Thread Zolvaring
In regards to your second question (sorry I missed it), the module looks okay except you need to indent the module out one more indentation space: - name: hosts: tasks: - get_url: url: The only other thing that looks immediately wrong to me is your destination parameter -- I

[ansible-project] New Ansible releases 2.8.4, 2.7.13, and 2.6.19

2019-08-15 Thread Toshio Kuratomi
Hi all- we're happy to announce that the general releases of Ansible 2.8.4, 2.7.13, and 2.6.19 are now available! How do you get it? -- $ pip install ansible==2.8.4 --user or $ pip install ansible==2.7.13 --user or $ pip install ansible==2.6.19 --user The tar.gz of the releases

[ansible-project] What is the best way to manage machines that aren't defined as hosts?

2019-08-15 Thread Kurt Robinson
I intend to Ansible to run deployment configuration on a number of Dell ESXi hosts in VMware using VMware and OpenManage modules. In my past ansible training, my playbooks have always run from hosts that I have defined in an inventory file. The machines I wish to configure don't have ansible

Re: [ansible-project] What is the best way to manage machines that aren't defined as hosts?

2019-08-15 Thread Zolvaring
I'm not sure I understand fully, but none of the hosts you are configuring need Ansible to be installed for you make changes remotely. Instead of defining your hosts in a CSV, define your hosts as part of Ansible inventory and your tasks will loop through them naturally. You can also group hosts

[ansible-project] how to use Ansible meta module to halt playbook execution upon task Failure.

2019-08-15 Thread Zolvaring
If you want to use meta it's simple but will not mark the play as failed, as far as I know there's no explicit way to do that with meta: - name: abort if string was found meta: end_play when: command is failed It might be better to try the fail module since it will return the failed state

[ansible-project] What is the best way to manage machines that aren't defined as hosts?

2019-08-15 Thread Zolvaring
I'm not sure I understand fully, but none of the hosts you are configuring need Ansible to be installed for you make changes remotely. Instead of defining your hosts in a CSV, define your hosts as part of Ansible inventory and your tasks will loop through them naturally. You can also group

[ansible-project] What is the best way to manage machines that aren't defined as hosts?

2019-08-15 Thread Zolvaring
Seeing that you may want to loop through actual guests, I would still define them as Ansible inventory hosts if you know them ahead of time, and if you need to run tasks from a different host by invoking VMware module then try: - name: do a thing to a guest vmware_module:

[ansible-project] Re: Erroneous playbook failure

2019-08-15 Thread Zolvaring
I don't know much about aide but that output appears to just show you what is being changed, is it possible aide simply uses rc 7 to denote that? If you don't believe the task is actually failing, try adding a param go the aide update task: register: aide_update failed_when: -