Re: [ansible-project] Re: Help with lineinfile

2017-05-08 Thread Mike Johnston
Thanks very much Philippe for the post. That's exactly what I'm trying to do. I'm still having an issue though with what you have below. If I change one of the variables, pam_fallock_unlock_time for example, it just adds another line instead of replacing the line. So I end up with two

[ansible-project] Is there any better way to find if a list of packes installed

2017-05-08 Thread Kiran Kumar
Hi Friends, Is there any better way to find if a list of packes is installed or not on a linux machine. It needs to return something may be a single variable to decide if all packages are installed or any one of them missed. Assuming i need to check if below packages are installed or not and

Re: [ansible-project] ansible ping hanging on a single node with no errors

2017-05-08 Thread David Binney
Normal ssh is fine and running with - gives no clues at all. It processes one host fine, then just hangs with no output at all. On Tue, 9 May 2017 at 4:09 am, Dick Davies wrote: > Well, back to basics. > > Can you SSH to the server manually? > If so, try adding

[ansible-project] Re: Permission problem with docker module.

2017-05-08 Thread Niels Baltodano
i have the same problem, but i try using shell module with "sudo docker build -f ." , this working but the console output show me warning message, any have solution. Sorry by my inglish El lunes, 25 de mayo de 2015, 4:29:37 (UTC-5), Stefan Eriksson escribió: > > Hi I'm trying out the docker

[ansible-project] run ssh command on Sonus SBC 5110 device ( only use raw module, no network module available for this device)

2017-05-08 Thread naeem dhby
Hi. i'm trying to run some show command with raw module on my Sonus device ( SBC 5110) but i get error in different condition: first i tried to run command with smart or default transport Here is playbook: > --- > - hosts: all > # gather_facts: false > # connection: local > tasks: > -

[ansible-project] Can't run ssh command on sonus SBC 5110 (raw command, no module available)

2017-05-08 Thread naeem dhby
Hi. i'm trying to run some show command with raw module on my Sonus device ( SBC 5110) but i get error in different condition: first i tried to run command with smart or default transport Here is playbook: > --- > - hosts: all > # gather_facts: false > # connection: local > tasks: > -

Re: [ansible-project] using a "when" for setting environment ?

2017-05-08 Thread Dick Davies
I think that's setting an environment variable called 'when' with a value of 'use_apt_mirror'. On 8 May 2017 at 10:04, Stephen Tan wrote: > > Will this work? > > environment: > http_proxy: "{{ apt_mirror }}" > when: use_apt_mirror > > So, I only want to set the

Re: [ansible-project] ansible ping hanging on a single node with no errors

2017-05-08 Thread Dick Davies
Well, back to basics. Can you SSH to the server manually? If so, try adding '-' to the ping task to see if that gives any clues. On 8 May 2017 at 09:35, David Binney wrote: > I am trying to run an ansible ping, but it it hanging on a single hostname, > and showing no

Re: [ansible-project] issue faced while changing permission of files and directories using file module in ansible 2.3.0

2017-05-08 Thread Dick Visser
You can't use the file module to recursively set permissions on files. Instead you could first use the find module, and then use file with with_items. Note that this can be quite slow as every file will be taken into account. I haven't found a way to instruct 'find' to only find files with (or

Re: [ansible-project] playbooks log viewer

2017-05-08 Thread Kai Stian Olstad
On 08. mai 2017 15:49, Rem wrote: Hi all, I work with Ansible, and usually, collect playbooks log inside a directory: /ansible/log/logs01 each log contains the JSON output for servers, eg: hostname.domain.com.json My question is, using Callback module (Callback plugins enable you to hook into

[ansible-project] Re: Unreachable error

2017-05-08 Thread amarreddi . s
On Thursday, 16 June 2016 05:58:39 UTC+5:30, navdeep uniyal wrote: > > Hi all, > > I am new to ansible. I have been learning ansible using ad hoc commands as > well as ansible playbooks. Things were running fine until I started getting > errors as given below. I have no idea how to resolve

[ansible-project] Expect Works but Returns Error Code

2017-05-08 Thread Scott Brumley
--- - name: NSP Playbook hosts: nsp gather_facts: no connection: local tasks: - expect: command: /usr/bin/ssh -tt killeruser@{{ inventory_hostname }} responses: ^.*[p|P]assword:\s*$: "somepassword" ^.*\>\s*$: - "show

[ansible-project] playbooks log viewer

2017-05-08 Thread Rem
Hi all, I work with Ansible, and usually, collect playbooks log inside a directory: /ansible/log/logs01 each log contains the JSON output for servers, eg: hostname.domain.com.json My question is, using Callback module (Callback plugins enable you to hook into Ansible events for display or

Re: [ansible-project] Re: Help with Basic IOS Command module

2017-05-08 Thread Peter Sprygada
Hi Sergey, can you provide more details about what isn't working in py3.5? On Sat, May 6, 2017 at 8:19 AM, wrote: > Hi Bain, > > It seems the ios_command module doesn't work with Python3.5. Try running > it with Python2.7. > > Regards, > Sergey > > > On Friday, 5 May

[ansible-project] run playbook in Ansible v2 with python

2017-05-08 Thread ESWAR RAO
Hi All, I am trying to invoke ansible playbook V2 from python modules. I am following below link: (1) http://docs.ansible.com/ansible/dev_guide/developing_api.html (2) http://stackoverflow.com/questions/37783145/how-to-run-playbook-api-in-ansible-v2 Can some one please help me/provide links

[ansible-project] Re: how do I use ios_config to change configuration to default?

2017-05-08 Thread Rama Krishna
Use Jinja2 template with ios_config, and set the module parameter match: line, which will do the job as you seek. cheers On Wednesday, April 26, 2017 at 6:39:48 PM UTC+5:30, John Z wrote: > > How do I use ios_config to delete configuration but only if it is present? > I want ios_config to

[ansible-project] Invoke Jinja2 template in a custom module

2017-05-08 Thread Rama Krishna
Hi Fellas, I'm trying to invoke jinja2 template to a custom module, but it end up i get only a string of file name instead of calling ansible container to get the jinja2 output. On debug i see, when the default modules call jinja2 template it automatically parses, but on custom modules it's

[ansible-project] Re: junos_command

2017-05-08 Thread Rama Krishna
Based on the error message, authentication parameters are not passed properly to the module. I see it's using netconf; so i think you have used connection method right.. Cheers On Wednesday, April 26, 2017 at 1:01:13 AM UTC+5:30, Asif Iqbal wrote: > > I am failing to make junos_command

[ansible-project] issue faced while changing permission of files and directories using file module in ansible 2.3.0

2017-05-08 Thread vibhav vishal singh
Hi All, I have been trying to avoid shell and command module to change permissions , I am using file module here . what I am trying : change permission of all directories inside a directory to 755 and all files to 644 . problem is I am not supposed to use shell and command module , so while

[ansible-project] Sort filter and python 3

2017-05-08 Thread Sergey Baranov
Hi everyone! I have this macro in jinja2 template to generate xml configs: {%- macro print_opts(options, indent=' ', count=0) %} {% for key in options.keys() | sort %} {% set value = options[key] %} {% if value is string %} {{- indent*count }}{{ key }} {{ '"' + value.split('\t') |

[ansible-project] Re: Help with Basic IOS Command module

2017-05-08 Thread serrbondar
Hi Bain, It seems the ios_command module doesn't work with Python3.5. Try running it with Python2.7. Regards, Sergey On Friday, 5 May 2017 01:15:02 UTC+10, bain wrote: > > If anyone is able to assist i would really appreciate it, I have spent > hours looking around ,fixing random things and

[ansible-project] unicode object has no attribute

2017-05-08 Thread Steven Rhodes
I am trying to understand the error message "ERROR! 'unicode object' has no attribute 'subnets'" As shown as an example at https://docs.ansible.com/ansible/ec2_vpc_subnet_facts_module.html My Code: --- # EC2 VPC - hosts: localhost vars: aws_access_key: "{{ aws.aws_access_key }}"

[ansible-project] Jinja2 sort filter and Python 3

2017-05-08 Thread Sergey Baranov
Hi everyone! I'm using this jinja2 macro for xml configs: {%- macro print_opts(options, indent=' ', count=0) %} {% for key in options.keys() | sort2 %} {% set value = options[key] %} {% if value is string %} {{- indent*count }}{{ key }} {{ '"' + value.split('\t') | join('" "') + '"'

[ansible-project] using a "when" for setting environment ?

2017-05-08 Thread Stephen Tan
Will this work? environment: http_proxy: "{{ apt_mirror }}" when: use_apt_mirror So, I only want to set the environment variable when the var "use_apt_mirror" is true. There is no obvious documentation to suggest that this won't work. -- You received this message because you are

[ansible-project] ansible ping hanging on a single node with no errors

2017-05-08 Thread David Binney
I am trying to run an ansible ping, but it it hanging on a single hostname, and showing no error or log messages. [defaults] host_key_checking = False command_warnings = False error_on_undefined_vars = True gathering = smart #ssh_args = -o ControlMaster=auto -o ControlPersist=30m inventory =