[ansible-project] Enforcing multiple parameters in a Module

2017-06-14 Thread MKPhil
I'm developing a Module and am trying to work out how to ensure my module gets the parameters it needs. There are two separate parameters, lets call them A and B. My Module requires that either just A is supplied, or just B, or both A *and *B - the only scenario that is not supported is no par

[ansible-project] Ansible role: test/test.yml

2017-06-14 Thread Listing
Hi, When initiating a role I noticed that there is a test folder being created with test.yml in it. When I run my roles in production environments, I always run roles by creating a playbook with the following contents: --- - hosts: webservers roles: - common - webservers When run

[ansible-project] how to override entry in a dictionary

2017-06-14 Thread 'Ansible Madness' via Ansible Project
hi assuming a have some dictionary variables defined in some group_vars location: level0: level1-a: somevalue: aaa someothervalue: 111 level1-b: somevalue: bbb someothervalue: 222 level1-c: somevalue: ccc someothervalue: 333 Basically i would like

[ansible-project] Re: Ansible: Need to send the text message (SMS) via ansible using the “Nexmo”. Getting below error

2017-06-14 Thread nishant bawane
even i have tried using the twilo still not able to get the output - - hosts: localhost tasks: - name: Send notification message via twilio twilio: msg: 'Hello from Nishant via Ansible' account_sid: ACxx auth_token: a0

[ansible-project] Send SMS using Twilio in ansible , getting below error

2017-06-14 Thread nishant bawane
i have tried using the twilo still not able to get the output - - hosts: localhost tasks: - name: Send notification message via twilio twilio: msg: 'Hello from Nishant via Ansible' account_sid: AC xx auth_token: a0xxx

[ansible-project] Unable to set hostnames with their Ip adresses in inventory file

2017-06-14 Thread fatimazahra . bouhajban
Hi All, I'm new to ansible. I'am trying to backup juniper routers configurations, i tried the following Yaml Script: *---* *- name: Get configuration* *hosts: all* * connection: local* * gather_facts: no* * roles:* *- Juniper.junos* * tasks:* *- name: Getting config ... please wa

[ansible-project] Ansible Role Variables as Defaults

2017-06-14 Thread Sam Darwin
Hi, A problem I have often encountered when writing Ansible Roles is that the precedence level of "vars" prevents overriding them - in group_vars, inventory, etc. Perhaps this can be a solution, a set_fact task which converts selected Role Variables into Default Variables: https://www.samda

[ansible-project] Re: Splitting a variable length list into a list of lists

2017-06-14 Thread Ed
It's a combination of both, actually. I can boost the nofile setting, but I'm still able to construct a large enough package list that it fails. Things work fine in Centos 7.x - I don't know if the resolution arrived in python or in Centos. I'm going to try using the batch filter for my sub-l

Re: [ansible-project] how to override entry in a dictionary

2017-06-14 Thread Philippe Eveque
May be below can be a hint http://docs.ansible.com/ansible/intro_configuration.html#hash-behaviour and http://docs.ansible.com/ansible/playbooks_filters.html#combining-hashes-dictionaries HTH 2017-06-14 11:50 GMT+02:00 'Ansible Madness' via Ansible Project < ansible-project@googlegroups.com>:

Re: [ansible-project] Enforcing multiple parameters in a Module

2017-06-14 Thread Brian Coca
ansible-devel is a better forum for this kind of question (both mailing list and IRC channel). -- 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 e

[ansible-project] Re: Splitting a variable length list into a list of lists

2017-06-14 Thread Ed
I think I have a working solution. The outer file has: - set_fact: batches: "{{ packages|batch(batch_size)|list }}" - include: run_installs.yml with_list: "{{ batches }}" loop_control: loop_var: batch Then run_installs.yml is simply: --- - name: Update an

Re: [ansible-project] how to count success and failure of a task ?

2017-06-14 Thread Gurminder Singh
sure thing, guess I need work on my code more, it is still workable as expected. Appreciate your help Brian. On Tuesday, 13 June 2017 20:24:25 UTC+5:30, Brian Coca wrote: > > register: myvar.results <= this is incorrect, you cannot register to > a subindex. > > correct: > register: myvar >

[ansible-project] how can we import terminal output of specific task/variable/message/debug in a excel sheet ?

2017-06-14 Thread Gurminder Singh
how can we import terminal output of specific task/variable/message/debug in a excel sheet ? -- 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+

[ansible-project] Module ec2_ami_find does not return data

2017-06-14 Thread Michael Bushey
I am able to spin up servers with the 'ec2' module. I'm running Ansible 2.3.1.0 from source on Ubuntu. ╰─➤ dpkg -l | grep -i boto

Re: [ansible-project] Module ec2_ami_find does not return data

2017-06-14 Thread Michael Bushey
If I spell 'available' correct I also get the template error. On Wed, Jun 14, 2017 at 11:38 AM, Michael Bushey wrote: > I am able to spin up servers with the 'ec2' module. I'm running Ansible > 2.3.1.0 from source on Ubuntu. > > ╰─➤ dpkg -l | grep -i boto > > >

[ansible-project] Prevent notify from restarting service if something else will

2017-06-14 Thread Gilberto Valentin
I have the following playbook: --- ## Tasks for software install - name: Java 1.8 yum: name={{ item }} state=installed with_items: - java-1.8.0-openjdk-devel - name: Guest groups group: name: '{{ guest_user_group }}' gid: '{{ guest_user_group_gid }}' - name: Default guest use

[ansible-project] Re: Ansible (ver 2.3.1) python module with boto3 successful but always get "msg": "MODULE FAILURE", "rc": 0

2017-06-14 Thread Dylan Silva
Hi Chris, Could you point us to your module? Did you create a net new module, or have you tried adding to the existing module (Preferred approach I might add). Also, I suggest reaching out to #ansible-devel. Someone there might be able to help you! On Wednesday, June 7, 2017 at 1:55:23 PM U

Re: [ansible-project] Re: Ansible (ver 2.3.1) python module with boto3 successful but always get "msg": "MODULE FAILURE", "rc": 0

2017-06-14 Thread Chris McConnell
Hello Dylan/All, I created a new module for our internal use, because the Ansible rds module defaults to use magnetic media which is not an option, or it will deploy with provisioned iops (where iops=1,000 is the minimum) which is too expensive for our use case. Note (played around with this

[ansible-project] Re: how can we import terminal output of specific task/variable/message/debug in a excel sheet ?

2017-06-14 Thread 'J Hawkesworth' via Ansible Project
You could register the results of whatever command output you are interested in, then use a local action (or delegate to localhost) task to append to a .csv file on your ansible controller. Then you could use win_copy to copy the .csv file over to a windows desktop machine so that it can be vi

[ansible-project] Can i use .yml file like this?

2017-06-14 Thread 강동인
tasks: - name: Variable set_fact: os: "ubi" host: "192.168.0.137" username: "root" password: "premier" commands: "show version" * module: "ios_command"* ### Working - name: Cisco ios command *ios_command:* host: "{{h