Re: [ansible-project] facing the problem in mapping network drive

2020-05-26 Thread mahesh g o
Hi Jordan, I tried the below playbook to store the credential that Windows will use for mapped drives. But it is throwing the below error : - hosts: [win] gather_facts: false tasks: - name: Save the network credentials required for the mapped drive win_credential: name:

Re: [ansible-project] facing the problem in mapping network drive

2020-05-15 Thread mahesh g o
Thanks Jordan, I used become in my playbook. - hosts: [win] gather_facts: false tasks: - name: create a mapped drive win_mapped_drive: state: present letter: D path: \\10.237.163.116\test vars: # become is required to save and retrieve the credentials in

Re: [ansible-project] facing the problem in mapping network drive

2020-05-14 Thread mahesh g o
d123 i am expecting the playbook use host_vars file to login to windows machine and mount the volume in z drive. On Thursday, 14 May 2020 16:32:00 UTC+5:30, Luca 'remix_tj' Lorenzetto wrote: > > Hello, > > On Thu, May 14, 2020 at 12:49 PM mahesh g o > wrote: > > i

[ansible-project] facing the problem in mapping network drive

2020-05-14 Thread mahesh g o
Hi , help is appreciated playbook:mount.yml - hosts: localhost gather_facts: false vars_files: - /etc/ansible/group_vars/host_vars tasks: - name: create a mapped drive under Z win_mapped_drive: letter: Z path: \\10.237.163.116\test username: test

Re: [ansible-project] Re: query on ansible

2020-04-17 Thread mahesh g o
okay, so if i use them as tasks, will svm.yml takes aggr array from aggr.yml?? On Fri, Apr 17, 2020 at 4:42 PM Stefan Hornburg (Racke) wrote: > On 4/17/20 1:08 PM, mahesh g o wrote: > > > > I am newbie to ansiblei have to create many objects like > this(aggr,svm,vol

Re: [ansible-project] Re: query on ansible

2020-04-17 Thread mahesh g o
12:55 PM, mahesh g o wrote: > > Thank u very much ...it worked. > > > > You are welcome. > > > I need one more helpthe aggr is coming from the playbook1. every > time i run that playbook1 individually and i enter > > the aggr array in p

[ansible-project] Re: query on ansible

2020-04-17 Thread mahesh g o
start=1 end=8 On Friday, 17 April 2020 14:24:51 UTC+5:30, mahesh g o wrote: > > I have below playbook: > > i have put a loop, there are 8 aggr and 4 protocols: this playbook output > is like after every 4 loop, it increments aggr and protocols. > > output of the playbook is

[ansible-project] query on ansible

2020-04-17 Thread mahesh g o
I have below playbook: i have put a loop, there are 8 aggr and 4 protocols: this playbook output is like after every 4 loop, it increments aggr and protocols. output of the playbook is: svm1,svm2,svm3,svm4---aggr1 and nfs svm5,svm6,svm7,svm8---aggr2 and iscsi svm9,svm10,svm11,svm12---aggr3

[ansible-project] looping through the 5 values

2020-04-07 Thread mahesh g o
I have below playbook which creates policy: i have parameter called policy which has 5 values(" mirror", "vault", "mirrorandvault", "default", "XDP") i have put with_sequence loop. i want this policy to be created with each loop. i tried ternary operator for 2 policies "type: "{{

[ansible-project] newbie to ansible

2020-04-06 Thread mahesh g o
I have the below playbook which creates 20 volumes i have parameter called *type *which has 2 values [ rw and dp]. my req is: how to create 10 volumes with type rw and 10 volumes type dp in one playbook. tasks: - name: Create FlexVol na_ontap_volume: state: absent

[ansible-project] loops in playbook

2020-04-06 Thread mahesh g o
below is loop i tried: tasks: - name: loops debug: msg: "{{ item.0 }}_{{ item.1 }}_{{ item.2 }}_{{item.3}}_{{item.4}}" loop: "{{ port | product(vserver,aggr,protocol,lif_name) | list }}" vars: port: - e0a - e0b - e0c -

[ansible-project] Re: how to Import multiple Playbooks into one single playbook

2020-04-03 Thread mahesh g o
username: "{{ aiqumusername }}" password: "{{ aiqumpassword }}" https: false with_sequence: start=1 end=4 On Friday, 3 April 2020 19:35:49 UTC+5:30, mahesh g o wrote: > > I have 8 playbooks. how do i import all 8 playbooks in 1 playbook. >

[ansible-project] how to Import multiple Playbooks into one single playbook

2020-04-03 Thread mahesh g o
I have 8 playbooks. how do i import all 8 playbooks in 1 playbook. below is the one of the playbook: which created 4 SVM's with fcp protocol , I have 7 more playbooks which each creates 4 svm's with different protocol. I want it to run one after the another. Playbook 1 which creates 4 svm's

[ansible-project] Re: combine the playbooks

2020-04-03 Thread mahesh g o
Thanks it worked On Tuesday, 31 March 2020 20:41:39 UTC+5:30, mahesh g o wrote: > > how to combine the playbooks: > > I have below 2 playbooks which creates 4 svm's each, one with nfs protocol > and another with fcpprotocol. > > Playbook 1 which creates 4 svm's with f

[ansible-project] Re: combine the playbooks

2020-03-31 Thread mahesh g o
only Plyabook 1 ran successfully, playbook 2 has not ran On Tuesday, 31 March 2020 20:41:39 UTC+5:30, mahesh g o wrote: > > how to combine the playbooks: > > I have below 2 playbooks which creates 4 svm's each, one with nfs protocol > and another with fcpprotocol. > > Playb

[ansible-project] combine the playbooks

2020-03-31 Thread mahesh g o
how to combine the playbooks: I have below 2 playbooks which creates 4 svm's each, one with nfs protocol and another with fcpprotocol. Playbook 1 which creates 4 svm's with fcp protocol - hosts: localhost gather_facts: false vars_files: - /etc/ansible/group_vars/host_vars tasks: -

[ansible-project] Re: counting the array of elements in ansible.

2020-03-19 Thread mahesh g o
Thanks it worked. vars: foo: ['vs1','vs2','vs3','vs4'] tasks: - name: counting the array elements debug: msg: "{{foo|length}}" On Thursday, 19 March 2020 20:53:58 UTC+5:30, mahesh g o wrote: > > - hosts: localhost > gather_facts: false >

[ansible-project] counting the array of elements in ansible.

2020-03-19 Thread mahesh g o
- hosts: localhost gather_facts: false vars: foo: ['vs1','vs2','vs3','vs4'] tasks: - name: counting the array elements yes: "{{foo|length}}" seeing the below error: not sure what am i missing here: ERROR! Syntax Error while loading YAML. mapping values are not allowed in

[ansible-project] Re: passing variable in another playbook

2020-03-17 Thread mahesh g o
newbie to ansible On Tuesday, 17 March 2020 10:30:30 UTC+5:30, mahesh g o wrote: > > i have created the list using set_fact and i want use this list in > another playbook. > i have stored the value in the ouput. > how do i use it in another playbook?? > > tasks: >

[ansible-project] passing variable in another playbook

2020-03-16 Thread mahesh g o
i have created the list using set_fact and i want use this list in another playbook. i have stored the value in the ouput. how do i use it in another playbook?? tasks: - name: Initialize an empty list for our strings set_fact: test: [] - name: second set_fact: