[ansible-project] How I write If syntax inside for syntax in template

2018-05-21 Thread Jatinder Jawanda
{% for item, value in {% if source == "cde" %} abc.iteritems() {% else %} def.iteritems() {% endif %} %} item {% endfor %} -- 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

[ansible-project] executing the previleage adhoc command

2018-05-21 Thread Kannappan M
Hi Team, When i try to shutdown the connected node using ansible am getting the below error kindly assist 128 ansible iaf -m shell "/usr/sbin/shutdown -h now" -b 129 ansible iaf -m shell "/usr/sbin/shutdown -h now" --become 130 ansible iaf -m shell '/usr/sbin/shutdown -h

Re: [ansible-project] Re: Issues connecting when using the ios_facts module

2018-05-21 Thread Matt Hickok
Hey Peter, was this what you mean by the asa_facts module? https://github.com/ansible/ansible/pull/37298 It looks like it's not included yet On Saturday, May 19, 2018 at 12:59:02 AM UTC-5, Matt Hickok wrote: > > Yea, I figured out point 1 eventually. > > As for ansible_network_os, I couldn't

[ansible-project] Re: Ansible GUI Tools

2018-05-21 Thread Tony Chia
Hi Carlton, You can use either the commerical Ansible Tower or the opensource version called AWX at github.com/ansible/awx if you need a GUI interface. On Sunday, May 20, 2018 at 12:37:25 PM UTC-7, Carlton Patterson wrote: > > Hello community, > > I am learning Ansible and I am getting familiar

Re: [ansible-project] executing the previleage adhoc command

2018-05-21 Thread Kai Stian Olstad
On 21.05.2018 17:51, Kannappan M wrote: When i try to shutdown the connected node using ansible am getting the below error kindly assist 128 ansible iaf -m shell "/usr/sbin/shutdown -h now" -b 129 ansible iaf -m shell "/usr/sbin/shutdown -h now" --become 130 ansible iaf -m

Re: [ansible-project] executing the previleage adhoc command

2018-05-21 Thread Kannappan M
Hi Kai, Please find the o/p below [tester@ansi root]$ ansible iaf -a "sudo /usr/sbin/shutdown -h now" ^C [tester@ansi root]$ sudo lvdisplay --- Logical volume --- LV Path/dev/centos/swap LV Nameswap VG Namecentos LV UUID

[ansible-project] Unable to run Jenkins in docker container using Ansible

2018-05-21 Thread Bishwajit Samanta
Dear All, I am not able to run jenkins inside docker container using ansible playbook. Jenkins is getting started but unable to run it - name: Download Jenkins Container docker_container: name: Jenkins_server image: jenkins state: started ports: - "8080:8080"

Re: [ansible-project] Ansible looping over register and multiple lists

2018-05-21 Thread David Villasmil
Please paste the code WITHOUT any formatting. Font should be any single-space so that spacing is correct. On Mon, May 21, 2018, 15:55 Jeremie Levy wrote: > Hi > I'm trying to do the following (in windows but it's not important): > > >1. Need to deploy N number of build

[ansible-project] Ansible looping over register and multiple lists

2018-05-21 Thread Jeremie Levy
Hi I'm trying to do the following (in windows but it's not important): 1. Need to deploy N number of build agents to a server (according to the inventory nb_of_agents) - *iteration1* 2. Each agent should have a unique port starting from 8811 - *iteration2* 3. Check if the service

[ansible-project] manage linux system policy routing?

2018-05-21 Thread cava cavamagie
i'm aunable to use the module net_static_route other ways? -- 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+unsubscr...@googlegroups.com. To

[ansible-project] procedure to run the previleages command in ansible 2.5

2018-05-21 Thread Kannappan M
Hi Team, Am facing problem in running elevated commands these are my tries kindly suggest a best solution to fix this problem. I dont have problem in running the normal ping command when i ran the elevated command am facing problem. [tester@ansi ~]$ ansible iaf -m command -a

Re: [ansible-project] manage linux system policy routing?

2018-05-21 Thread Peter Sprygada
net_static_route is designed to be used with traditional routers and switches and will not work with Linux hosts On Mon, May 21, 2018 at 6:08 AM, cava cavamagie wrote: > i'm aunable to use the module net_static_route > other ways? > > -- > You received this message because

[ansible-project] Ansible ping to Windows fails with credssp , “Session' object has no attribute 'merge_environment_settings”

2018-05-21 Thread Harshit Srivastava
I have configured Ansible on my ubuntu 14.04 and my target machine is a windows server 2016, but it fails when using credssp or plain text: I tried: *ansible -m win_ping all --ask-pass -vvv* Below is the output I see: ansible 2.5.3 config file = /etc/ansible/ansible.cfg configured

Re: [ansible-project] manage linux system policy routing?

2018-05-21 Thread cavamagie
Yes.. Ther is other modulo or file ti manage So Linux similar ti win_route? Il lun 21 mag 2018, 20:32 Peter Sprygada ha scritto: > net_static_route is designed to be used with traditional routers and > switches and will not work with Linux hosts > > On Mon, May 21, 2018 at

Re: [ansible-project] procedure to run the previleages command in ansible 2.5

2018-05-21 Thread Matt Martz
You have shown /etc/passwd, /etc/group, and /etc/sudoers from the machine you are running ansible from. However, those configs will also be required on the `iaf` machine as well. That is where `/usr/sbin/shutdown` will be run, and where the sudo configuration matters. On Mon, May 21, 2018 at

[ansible-project] Ansible unable to except any other body format except raw and jason in the uri module and upload a zip or a jar via POST method

2018-05-21 Thread Apu Mondal
Zip file not getting POST to the server with the uri module in Ansible. These are the codes I am trying to execute - name: Transfering the Proxies uri: headers: Authorization: '{{API_USER_PASS_BASE64_ENCRYPT}}' Content-Type: "application/octet-stream" url:

[ansible-project] How to use the cache plugins for example the "yaml - YAML formatted files" plugin

2018-05-21 Thread Ibrahim Mohamed
How to use the cache plugins for example the "yaml - YAML formatted files" plugin There is no documentation or examples https://docs.ansible.com/ansible/2.5/plugins/cache/yaml.html -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To

Re: [ansible-project] How to use the cache plugins for example the "yaml - YAML formatted files" plugin

2018-05-21 Thread Matt Martz
Start with the more generic docs for caching plugins, which can be found at https://docs.ansible.com/ansible/2.5/plugins/cache.html The above link describes how to enable the plugins. On Mon, May 21, 2018 at 3:42 PM, Ibrahim Mohamed wrote: > How to use the cache plugins for

[ansible-project] control of network flows and ports between servers

2018-05-21 Thread Diego Lagos
Currently I have a small problem, but that takes a lot of time. This is the control of network flows. Specifically, check that every time I have a new machine, flows and ports have also been opened to other machines. The problem therefore is not only to verify that the flow is present, but

[ansible-project] How to use group_vars when managed host is in multiple groups?

2018-05-21 Thread bob
Maybe the question I should be asking is how do people manage what packages get installed on what computers? My approach might be wrong? I'm trying to figure out how to use group_vars for chocolatey packages to install when the managed host is in multiple groups. I'd like to append package

[ansible-project] Quick way for testing new Ansible roles

2018-05-21 Thread Behrang
Hi, In the docs , it is written that: Test It The actual work to be performed gets added as playbook tasks to *tasks/main.yml*. Once you've added some tasks, create a playbook to test the role and insure it works. Here's a simple playbook to

Re: [ansible-project] Need help to find how to run root command with non-root user and escalated privilages

2018-05-21 Thread Brian Coca
You seem to have a non standard/old sudo, change the default become_flags as they seem to be causing the problem, specifically, remove -n (default: '-H -S -n' ) -- -- Brian Coca -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To

Re: [ansible-project] Need help to find how to run root command with non-root user and escalated privilages

2018-05-21 Thread abhay srivastava
Try: - hosts: dpie_prod user: dpiesa become: True tasks: - name: install telnet yum: pkg=telnet state=installed update_cache=true #command: sudo yum install telnet -y On Sat, May 19, 2018 at 12:56 AM, 'Kallu Srikanth' via Ansible Project < ansible-project@googlegroups.com>

Re: [ansible-project] Ansible looping over register and multiple lists

2018-05-21 Thread Jeremie Levy
Hi David Here it is: - name: check service '{{ item }}' is not already running win_service: name: Build Agent Prod '{{ item }}' register: svc with_sequence: start=1 end='{{nb_of_agents}}' - name: output debug: var: svc - name: output

[ansible-project] Re: Quick way for testing new Ansible roles

2018-05-21 Thread BIJAY PARIDA
Host example is not a valid host name. - hosts: localhost On Tuesday, 22 May 2018 07:31:24 UTC+5:30, Behrang wrote: > > Hi, > > In the docs , it is written > that: > > Test It > > The actual work to be performed gets added as playbook tasks to >

Re: [ansible-project] Need help to find how to run root command with non-root user and escalated privilages

2018-05-21 Thread David Villasmil
I think if you set 'become' then you don't need to use sudo. Also, why don't you use the module to install packages instead of executing yum? http://docs.ansible.com/ansible/latest/modules/yum_module.html Example: - name: install one specific version of Apache yum: name:

Re: [ansible-project] Ansible looping over register and multiple lists

2018-05-21 Thread Jordan Borean
You can't normally run in parallel with a loop, they are run sequentially. You can hack around it by running with async and poll 0 and then poll that status but it isn't a perfect "run all items in list in parallel" that you are looking for. Your debug output - name: output debug: var:

Re: [ansible-project] Ansible looping over register and multiple lists

2018-05-21 Thread Jeremie Levy
Thank you Jordan Actually, I also tried without the "." as you suggested and it didn't work Code: - name: output debug: var: qb_svc - name: output debug: var: qb_svc.results[item].exists with_sequence: count='{{nb_of_agents}}' Here is my output

[ansible-project] paper ansible

2018-05-21 Thread Raxeon
hey guys, i get assignment from my teacher, do you know where i can get paper or journal about ansible? thanks.. -- 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

Re: [ansible-project] merge two sets of AWS tags?

2018-05-21 Thread Kai Stian Olstad
On 21.05.2018 05:27, Karl Auer wrote: So I will generally have some standard tags set up in a variable like this: standard_tags: Name: AServer CostCentre: Operations Then I generate some extra tags, so I have another variable somewhere like this: extra_tags: fred: wilma barney:

Re: [ansible-project] paper ansible

2018-05-21 Thread Prasad Mukhedkar
You can get lots of details about ansible and ansible tower at : https://www.ansible.com/resources Regards, Prasad Mukhedkar On Mon, May 21, 2018 at 1:33 PM, Raxeon wrote: > hey guys, i get assignment from my teacher, > do you know where i can get paper or journal about

[ansible-project] How to remove unused/old configuration automatically using Ansible?

2018-05-21 Thread SK
I am currently using Ansible to generate running configuration for the network devices. Here is the simple scenario I have. I have defined the interface type (routed, access, trunk) in the variables file and then created a jinja file that will generate the necessary configuration based on