[ansible-project] Re: ssh transport and windows

2019-04-06 Thread Varun Chopra
SSH is not supported on Windows.

On Saturday, April 6, 2019 at 1:44:27 PM UTC+5:30, sergey@gmail.com 
wrote:
>
> Hello.
>
> I am aware of the support for SSH in Windows 2019 and Windows 10.
> I installed the OpenSSH in Windows 8.1 and tried to enter it. All is well.
> But if you turn on ssh transport in ansable, then nothing works :(
>
> 1. I have not done something in Windows 8.1 and it works in Windows 2019 
> and Windows 10?
> 2. Or ansibla does not support work in Windows through SSH at all?
>
> thank
>
> P.S. I am using the ansible version : 2.7.9
>

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/e54deef5-2ee6-4f21-8f8c-eab50ccbb73b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Want to change the installatin path using win_package

2019-01-20 Thread Varun Chopra
Also might wanna add /q

On Sunday, January 20, 2019 at 10:42:43 PM UTC+5:30, Varun Chopra wrote:
>
> - name: installation of the package in D drive
>   win_package: 
>  path: \\Network\\path\\rabbitmq.exe
> arguments: INSTALLDIR="D:\Program Files"
>
> should work. Please post the verbose output here. (use -)
>
>
> On Sunday, January 20, 2019 at 7:48:55 PM UTC+5:30, shya...@gmail.com 
> wrote:
>>
>> Hi,
>>
>> I want to change the new software installation path from C:\ to D:\ but 
>> the installation is going to the C:\ drive and the following playbook not 
>> worked. The package is at shared network path.
>>
>>
>> - name: installation of the package in D drive
>>win_package: 
>>  path: \\Network\\path\\rabbitmq.exe
>>  arguments: "INSTALLDIR=D:\Program Files"
>>   
>>
>> Also tried the following
>>
>> - name: installation of the package in D drive
>>   win_package:
>> path: \\Network\\path\\rabbitmq.exe
>> arguments*:*
>> *  - /D=D:\\Program Files*
>>   - /install
>>
>>Can any one help.
>>
>> Thanks and Regards,
>>
>> Shyam
>>
>>
>>
>>
>>

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/d7f00f67-f3de-4dfa-a86f-75d85df4cb6f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Want to change the installatin path using win_package

2019-01-20 Thread Varun Chopra
- name: installation of the package in D drive
  win_package: 
 path: \\Network\\path\\rabbitmq.exe
arguments: INSTALLDIR="D:\Program Files"

should work. Please post the verbose output here. (use -)


On Sunday, January 20, 2019 at 7:48:55 PM UTC+5:30, shya...@gmail.com wrote:
>
> Hi,
>
> I want to change the new software installation path from C:\ to D:\ but 
> the installation is going to the C:\ drive and the following playbook not 
> worked. The package is at shared network path.
>
>
> - name: installation of the package in D drive
>win_package: 
>  path: \\Network\\path\\rabbitmq.exe
>  arguments: "INSTALLDIR=D:\Program Files"
>   
>
> Also tried the following
>
> - name: installation of the package in D drive
>   win_package:
> path: \\Network\\path\\rabbitmq.exe
> arguments*:*
> *  - /D=D:\\Program Files*
>   - /install
>
>Can any one help.
>
> Thanks and Regards,
>
> Shyam
>
>
>
>
>

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/f2c5aa4f-943c-40c0-b9ec-d5f00914011d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: "/bin/sh: 1: powershell: not found\n"

2018-11-10 Thread Varun Chopra
You're defining localhost under the win hostgroup and setting its 
connection to local.

I think you should look up Ansible guides first. I dont mean any offense.

On Saturday, November 10, 2018 at 6:42:12 PM UTC+5:30, Akshay Kaushik wrote:
>
>
>
> On Saturday, October 27, 2018 at 6:14:04 PM UTC+5:30, Jordan Borean wrote:
>>
>> You are running the module over SSH with the wrong shell plugin. Ensure 
>> this is run with either ‘ansible_connection: winrm’ or ‘ansible_connection: 
>> psrp’ so the PowerShell modules work properly.
>
>
> Hi,
>
> Sorry for late response. Below is my host file:-
>
> [win]
>
> localhost ansible_connection=local
>
> [win:vars]
> ansible_connection=winrm
> ansible_ssh_port=5986
> ansible_ssh_user=Administrator
> ansible_ssh_pass={{  }}
> ansible_winrm_server_cert_validation=ignore
>
>
> Please see and tell what i am doing wrong.
>
>

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/78e8d5d3-2a89-4b64-96e2-315b973f700d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: open command line installer by playbook

2018-10-13 Thread Varun Chopra
If you can do it through a shell script, you can use the same script in 
Ansible.

On Saturday, October 13, 2018 at 2:57:57 PM UTC+5:30, 
aakanks...@webdunia.net wrote:
>
> Hello,
>
> I have software, where I need to run ./install.bin command as a output it 
> open a command line installer to provide requested value of variables.
> How can I achieve this by ansible playbook.
>

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/156b6007-c9a3-4dd4-92d3-17c82640086f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Oracle 12C hangs with while doing unattended installation

2018-09-23 Thread Varun Chopra
For msi and exe packages - use win_package as a rule of thumb. If you still 
have issues with these, you can report an issue here 
https://github.com/ansible/ansible/issues because the module's supported by 
the community.

win_command shouldn't be used for installations as it usually ends up in a 
hit or a miss situation. If win_package doesn't work for you, you can try 
putting your win_command arguments as a pwsh script, saving it on the 
target node, and running that script through a remote powershell session. 
If you don't know how to do that, you can look up invoke-command or 
new-pssession. Ansible uses winrm as well so any issues you have with 
ansible should be visible by running this script remotely.

On Sunday, September 23, 2018 at 11:07:17 PM UTC+5:30, Isha G wrote:
>
> For SQL we used win_command so I thought that should work for Oracle but 
> it doesn't seem to work. Should I try through remote power shell ?
>
> On Sunday, September 23, 2018, Varun Chopra  > wrote:
>
>> That wasn't my question though.
>>
>> If you can run it remotely from another windows vm you should be able to 
>> see where it breaks side-by-side. Also, is there a reason you're not using 
>> win_package?
>>
>>
>>
>> On Sunday, September 23, 2018 at 10:49:19 PM UTC+5:30, Isha G wrote:
>>>
>>> I have just tried it locally and manually and it works every time. I 
>>> just created a couple of new Windows servers and installing it with ansible 
>>> hangs again so it does not seem to be a cleanup issue.  
>>> 
>>> On Sunday, September 23, 2018, Varun Chopra  wrote:
>>>
>>>> Can you install it remotely via invoke-command?
>>>>
>>>> -- 
>>>> 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-proje...@googlegroups.com.
>>>> To post to this group, send email to ansible...@googlegroups.com.
>>>> To view this discussion on the web visit 
>>>> https://groups.google.com/d/msgid/ansible-project/9521693a-69d2-4cdb-a16b-cde2f135bd46%40googlegroups.com
>>>> .
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>> -- 
>> 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-proje...@googlegroups.com .
>> To post to this group, send email to ansible...@googlegroups.com 
>> .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/ansible-project/c5241128-da63-4615-8780-3d3aff376e15%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/ansible-project/c5241128-da63-4615-8780-3d3aff376e15%40googlegroups.com?utm_medium=email_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/d21fa7c4-83d2-43ee-9350-191af3662f5b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Oracle 12C hangs with while doing unattended installation

2018-09-23 Thread Varun Chopra
That wasn't my question though.

If you can run it remotely from another windows vm you should be able to 
see where it breaks side-by-side. Also, is there a reason you're not using 
win_package?



On Sunday, September 23, 2018 at 10:49:19 PM UTC+5:30, Isha G wrote:
>
> I have just tried it locally and manually and it works every time. I just 
> created a couple of new Windows servers and installing it with ansible 
> hangs again so it does not seem to be a cleanup issue.  
> 
> On Sunday, September 23, 2018, Varun Chopra  > wrote:
>
>> Can you install it remotely via invoke-command?
>>
>> -- 
>> 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-proje...@googlegroups.com .
>> To post to this group, send email to ansible...@googlegroups.com 
>> .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/ansible-project/9521693a-69d2-4cdb-a16b-cde2f135bd46%40googlegroups.com
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/c5241128-da63-4615-8780-3d3aff376e15%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Oracle 12C hangs with while doing unattended installation

2018-09-23 Thread Varun Chopra
Can you install it remotely via invoke-command?

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/9521693a-69d2-4cdb-a16b-cde2f135bd46%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Transfer execute and delete script python via playbook

2018-08-02 Thread Varun Chopra
Hi Vince,

script will delete your script on it's own after executing it, similar to 
other modules. 

https://github.com/ansible/ansible/blob/0461620b2ddc7e8c0bf00bf8b7b95edd3a4c109c/lib/ansible/plugins/action/script.py#L144

On Thursday, August 2, 2018 at 1:51:05 PM UTC+5:30, Vincent Descargues 
wrote:
>
> Hello, 
>
> I would like to know how it is possible with a command to be able to both 
> transfer execute and delete a python script via a playbook. Currently I do 
> it in 3 lines: 1) Transfer 2) Execute 3) Delete.
>
> I could see on different forum that we could use the function "script"
>
>
> My current playbook :
> hosts: host
> - name: download python script
> copy: 
> src: /etc/ansible//python.py 
> dest: /etc/sssd/ 
> - name: execute python script 
> command: python /etc/sssd/python.py 
> - name: delete python script 
> command: rm /etc/sssd/python.py
>
>
>
>
> In fact, I would like to be able to transfer the python script, execute it 
> and delete it because I do not want to store it on the machine where it 
> runs.
>
>
> (example command "script" find on internet) I tried it but it does not 
> work :
>
> - hosts: my-servers sudo: true tasks: - script: 
> /home/stuart/scripts/setup.sh --creates /home/stuart/installed-git.txt
>
> Thanks a lot for answer.
>
> Vincent
>

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/ac362fa4-6327-4c37-a0db-f84400d188ff%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: win_disk_facts - get size and size remaining

2018-05-10 Thread Varun Chopra
This is pretty much why I was in favor of a separate module for volumes. 
I'd encountered the same issues but I ended up making my own module for 
it.  You can take a look at this if it suits your fancy: 
https://github.com/chopraaa/win_volume_facts/

It's kinda shit tbh but hey, it does the job.

On Thursday, May 10, 2018 at 4:52:46 PM UTC+5:30, Jeremie Levy wrote:
>
> Hi
> I'm trying to use win_disk_facts new module.
>
> I would like to get the size and remaining size of each 
> disk/partition/volume.
>
> Is there a way to "discover" how many of them there are in a kind of loop ?
>
> - name: Get disk facts
> win_disk_facts:
>   - name: Output first disk size
> debug:
>   msg: '{{ disk1s }}' 
> vars: 
>   disk1s: '{{ ansible_facts.disks[0].partitions[0].volumes[0].size }}'
>
> This one gives me info on the first partition, what about the others ? if 
> there is 1 or 20 ?
>
> Thanks!
>
> @marqelme
> @jborean93
>

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/a42f050d-cc1c-4461-b66d-602daa38ba36%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: recommended indent style for tasks

2018-05-04 Thread Varun Chopra
This is:

But later on, in the "Basics" header there's an alternate style, where each 
task item is indented a shift-width deeper then the "task:" keyword.

On Tuesday, May 1, 2018 at 5:07:09 PM UTC+5:30, Josef Fortier wrote:
>
> I'm modifying an EOL vim ansible plugin for my own use and am wondering 
> about indent style. In the Ansible Intro to Playbooks doc ( 
> http://docs.ansible.com/ansible/latest/user_guide/playbooks_intro.html ) 
> there are two separate styles on the same page:
>
> At the start of the doc, each task item has it's leading dash flush with 
> the "task:" keyword indent.
>
> But later on, in the "Basics" header there's an alternate style, where 
> each task item is indented a shift-width deeper then the "task:" keyword.
>
> Both seem to work with python's YAML parser.
>
> The second example appears to be slightly more common. Is there a 
> recommended style?
>
> Is there a more common/consensus style?
>

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/0bfc61f6-804f-46fe-918a-2307fb12c97c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Using 2 ansible versions

2018-05-01 Thread Varun Chopra
Thanks man. Wasn't sure if i should run ansible from source or install it 
in the virtualenv using pip.

On Tuesday, May 1, 2018 at 3:59:36 PM UTC+5:30, Varun Chopra wrote:
>
> Hi,
>
> I'm trying to install Ansible 2.3 on a server with 2.5 already present.
>
> I built and installed virtualenv and download ansible 2.3 and initiated a 
> virtualenv using source ./hacking/env-setup
>
> Will this new installation hinder with the 2.5 install in any way?
>
> How long does the virtualenv exist? How do I close the virtualenv and go 
> back to using 2.5?
>

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/3697eb2f-e34e-47b8-a726-537509539d9c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Using 2 ansible versions

2018-05-01 Thread Varun Chopra
Hi,

I'm trying to install Ansible 2.3 on a server with 2.5 already present.

I built and installed virtualenv and download ansible 2.3 and initiated a 
virtualenv using source ./hacking/env-setup

Will this new installation hinder with the 2.5 install in any way?

How long does the virtualenv exist? How do I close the virtualenv and go 
back to using 2.5?

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/064ac204-815a-4fe3-877c-5058606f3dbf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Molecule/testinfra

2018-04-27 Thread Varun Chopra
You wouldn't.

You're supposed to test things before you deploy them.

On Thursday, April 26, 2018 at 11:40:10 PM UTC+5:30, Chris Short wrote:
>
> Is anyone using molecule/testinfra to test real infrastructure (verifying 
> things ansible has managed)? The unit testing of playbooks is awesome but 
> how would I use the framework to test real things on real systems?
>

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/c564181d-8a93-4071-96ec-832e0c0faf24%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Creating multiple dest files using templates.

2018-04-26 Thread Varun Chopra
I'm trying to parse a csv using the template module:

host1,fqdn1,...
host2,fqdn2,...



{% for item in csvfile.split("\n") %}
{%   if loop.index != 0 %}
{% set list = item.split(",") %}
[col1]
name: '{{ list[0] | trim() }}'
label: '{{ list[11] | trim() }}'
[options]
followup = yes
{%   endif %}
{% endfor %}



This works fine for creating a single file from the template, but I want to 
create seperate files, depending on the value of list[3], for example zone.

That way I'd get 2 files, zone1, zone2, and each file will have the rows 
that contain list[3] as zone1, and so on.

My current play is like this:

  vars:
csvfile: "{{ lookup('file', 'ou.csv') }}"
  tasks:
- name: "Parse csv"
  template:
src: iterate.csv.j2
dest: iterate.ini


What changes would I have to make to the template and play to incorporate 
this?

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/dd2dd4e5-c9a7-4407-88ad-d777eec74399%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: need help to install Visual studio code on linux machine through Ansible

2018-04-12 Thread Varun Chopra
Your question is more suited for 
https://github.com/mhalano/ansible-role-visual-studio-code/issues

On Wednesday, April 11, 2018 at 4:23:22 PM UTC+5:30, Vishal Mane wrote:
>
> I took a role to install vs code from github. now trying to run the role, 
> it gets executes successfully, but vs code doesn't gets installed on the 
> target machine.
> my playbook is 
>
>- 
>- ---
>- - hosts: 
>-   become: true
>-   become_method: sudo
>-   roles:
>-  - { role: working-ansible-role-visual-studio-code, x: 42 }
>- 
>
> I cloned the role from this path --- 
> https://github.com/mhalano/ansible-role-visual-studio-code
>
>
> runnung playbook as -ansible-playbook -i   name>.yml --ask-sudo-pass
>
>
>
>

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/f78cb6bb-29c5-4775-b231-b645c1b5991e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] yum throws error if you give it a mix of sources

2018-03-17 Thread Varun Chopra
This works:

- name: "Enable repos"
  yum:
name: "{{ item }}"
state: present
  with_items:
- https:
//fedorapeople.org/groups/katello/releases/yum/3.4/katello/el7/x86_64/katello-repos-latest.rpm
- https:
//yum.theforeman.org/releases/1.15/el7/x86_64/foreman-release.rpm
- https://yum.puppetlabs.com/puppetlabs-release-pc1-el-7.noarch.rpm
- https:
//dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
- name: "Install foreman-scl"
  yum:
name: foreman-release-scl
state: present

This doesn't:

- name: "Enable repos"
  yum:
name: "{{ item }}"
state: present
  with_items:
- https:
//fedorapeople.org/groups/katello/releases/yum/3.4/katello/el7/x86_64/katello-repos-latest.rpm
- https:
//yum.theforeman.org/releases/1.15/el7/x86_64/foreman-release.rpm
- https://yum.puppetlabs.com/puppetlabs-release-pc1-el-7.noarch.rpm
- https:
//dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
- foreman-release-scl
state: present

Shouldn't this ^ work as well?

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/70f9ce02-ee2b-46ea-83bf-6c0a289ddb54%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Is there any Ansible master / Slave concept.

2018-03-13 Thread Varun Chopra
http://lmgtfy.com/?q=ansible+tower

On Monday, March 12, 2018 at 9:52:34 PM UTC+5:30, rrak...@gmail.com wrote:
>
> Thanks for teh information @Brian, Can you point any link to over for 
> Tower/AWX  you just mentioned.
>
> On Monday, March 12, 2018 at 9:48:08 PM UTC+5:30, Brian Coca wrote:
>>
>> We try to avoid slavery in all contexts  that said there is a 
>> 'controller' vs 'target' concept and when using ansible-pull you have 
>> 'server' vs 'client'. 
>>
>> If you look at Tower/AWX you have other ways of clustering the control 
>> nodes. 
>>
>>
>>
>> -- 
>> -- 
>> 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 email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/0897c9b7-1f11-4a4c-ab51-b1161218d96d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: New Ansible setup architecture

2018-03-12 Thread Varun Chopra
I'd like to know the point of running ansible in containers. I'm sort of 
new to this. Would be great if you could help out.

On Monday, March 5, 2018 at 6:01:16 PM UTC+5:30, DevOpsUnleashed wrote:
>
> I am tasked with setting up Ansible in my team.
>
> In another team, we setup Ansible in a docker image, and spun up a new 
> container per playbook execution.
>
> Question - what general setup architecture should i use?.  (E.g. dedicated 
> ansible control servers, dock
> er containers, cloud instances, etc)
>
>

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/6eb871fd-b670-46bf-bbda-799c5534dbf1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Ansible Disk Usage and Disk Space Full Alert generation Script.

2018-03-12 Thread Varun Chopra
This thread is filled with red flags, and im not even talking about the 
fact that he's using ansible for monitoring

On Monday, March 12, 2018 at 2:27:05 PM UTC+5:30, Jean-Yves LENHOF wrote:
>
>
>
> Le 08/03/2018 à 05:43, Kiran Shrimali a écrit :
>
> Hi, 
>
> I am tryig to write an Ansible script which will Generat Alert on Disk 
> Usage. Once the Disk Usage goes above the Threshold, alert will be 
> generated. 
>
> Below is start up code.
>
> ---
>  - hosts: "{{ hostGroup }}"
>user: gamesroot
>become: true
>become_user: root
>gather_facts: no
>tasks:
>- shell: df -h "{{ item }}" | tail -n 1 | awk {'print $5 '}  | sed 
> 's/%//g'
>  with_items:
>   - /
>   - /home
>   - /backup
>  register: test
>
>- debug:
>msg: "{{ test.results|map(attribute='stdout')|list }}"
>- name: Size is big
>  shell: echo "tobig size "
>  when: test.results > 20
> ~`
>
>
> Why not using ansible_mounts fact instead of running df ? Shell task 
> should be avoided each time it is possible !
> It already has information about FS
>
> Regards,
>
> JYL
>

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/178a67ff-f585-4e5c-ab58-60eff81a0f21%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Ansible Disk Usage and Disk Space Full Alert generation Script.

2018-03-12 Thread Varun Chopra
Don't mind the messed up indent...

On Monday, March 12, 2018 at 1:50:23 PM UTC+5:30, Varun Chopra wrote:
>
> You can use it as a role and loop over it:
>
> - name: Disk role.
>   include_role:
> name: disk_role
>   vars:
> mount_point: "{{ item }}"
>
>   with_items:
> - "/dev"
> - "/backup"
>
>
> On Monday, March 12, 2018 at 12:15:33 PM UTC+5:30, Kiran Shrimali wrote:
>>
>> ---
>>  - hosts: test-servers
>>user: gamesroot
>>become: true
>>become_user: root
>>gather_facts: yes 
>>vars:
>>mountpoint: "{{m}}"
>>
>>tasks:
>>- shell: df -h "{{mountpoint}}" | tail -n 1 | awk {'print $5 '}  | sed 
>> 's/%//g'
>>  register: test
>>
>>- shell: rm -rf /tmp/disk.txt; touch /tmp/disk.txt
>>  delegate_to: localhost
>>  
>>- shell: echo "{{ inventory_hostname }}"
>>  register: op
>>
>>- debug:
>>msg:
>>  - "{{test.stdout}}"
>>  - "{{ op.stdout }}"
>>
>>- name: add lines
>>  lineinfile: 
>>dest: /tmp/disk.txt 
>>line: "{{ m }} HAS REACHED {{ test.stdout }} % ON {{ op.stdout }}, 
>> KINDLY CHECK !!!"
>>state: present
>>  delegate_to: 127.0.0.1 
>>  register: msgtxt
>>  with_items:
>>- "{{ test.stdout }}"
>>- "{{ op.stdout }}"
>>  when: test.stdout|int > 5 
>>- local_action: copy content= "{{ msgtxt.results }}" 
>> dest=/tmp/disk2.txt 
>>
>>
>> I have create this , everything is working fine.. Now i am giving 
>> mountpoint at the run time. 
>> Now if i want to define more then one 1 mountpoint, how can it will 
>> compete the full loop for one mount point and next it will jump on second 
>> mountpoint. 
>>
>> e.g. vars:
>>mountpoint: 
>>- /
>>- /home
>>- /backup
>>- /dev
>>
>> On Friday, March 9, 2018 at 6:52:58 PM UTC+5:30, Thomas Hikade wrote:
>>>
>>> In addition you might like to print out the name of your FS which is too 
>>> big. For that you need the names again in the last debug loop.
>>> You could fix that like this, using advanced looping statement 
>>> "with_together" (Ansible Loops 
>>> <https://docs.ansible.com/ansible/latest/playbooks_loops.html#looping-over-parallel-sets-of-data>
>>> )
>>>
>>>   vars:
>>> filesystems:
>>>   - /
>>>   - /tmp
>>>
>>> size_too_big: "20"
>>>
>>>   tasks:
>>>
>>> ...
>>>
>>>   - name: Size is big v2
>>> debug:
>>>   msg:  "{{ item.1 }} is too big! size={{ item.0 }} "
>>> when: item.0 > size_too_big
>>> with_together:
>>>- "{{ test.results|map(attribute='stdout')|list }}"
>>>- "{{ filesystems }}"
>>>
>>> This will produce the following output:
>>>
>>> TASK [Size is big v2] 
>>> **
>>> ok: [demobox] => (item=[u'37', u'/']) => {
>>> "item": [
>>> "37",
>>> "/"
>>> ],
>>> "msg": "/ is too big! size=37 "
>>> }
>>> ok: [demobox] => (item=[u'37', u'/tmp']) => {
>>> "item": [
>>> "37",
>>> "/tmp"
>>> ],
>>> "msg": "/tmp is too big! size=37 "
>>> }
>>>
>>>
>>>

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/96c1e197-5098-4c11-a581-433f876d18f2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Ansible Disk Usage and Disk Space Full Alert generation Script.

2018-03-12 Thread Varun Chopra
You can use it as a role and loop over it:

- name: Disk role.
  include_role:
name: disk_role
  vars:
mount_point: "{{ item }}"

  with_items:
- "/dev"
- "/backup"


On Monday, March 12, 2018 at 12:15:33 PM UTC+5:30, Kiran Shrimali wrote:
>
> ---
>  - hosts: test-servers
>user: gamesroot
>become: true
>become_user: root
>gather_facts: yes 
>vars:
>mountpoint: "{{m}}"
>
>tasks:
>- shell: df -h "{{mountpoint}}" | tail -n 1 | awk {'print $5 '}  | sed 
> 's/%//g'
>  register: test
>
>- shell: rm -rf /tmp/disk.txt; touch /tmp/disk.txt
>  delegate_to: localhost
>  
>- shell: echo "{{ inventory_hostname }}"
>  register: op
>
>- debug:
>msg:
>  - "{{test.stdout}}"
>  - "{{ op.stdout }}"
>
>- name: add lines
>  lineinfile: 
>dest: /tmp/disk.txt 
>line: "{{ m }} HAS REACHED {{ test.stdout }} % ON {{ op.stdout }}, 
> KINDLY CHECK !!!"
>state: present
>  delegate_to: 127.0.0.1 
>  register: msgtxt
>  with_items:
>- "{{ test.stdout }}"
>- "{{ op.stdout }}"
>  when: test.stdout|int > 5 
>- local_action: copy content= "{{ msgtxt.results }}" 
> dest=/tmp/disk2.txt 
>
>
> I have create this , everything is working fine.. Now i am giving 
> mountpoint at the run time. 
> Now if i want to define more then one 1 mountpoint, how can it will 
> compete the full loop for one mount point and next it will jump on second 
> mountpoint. 
>
> e.g. vars:
>mountpoint: 
>- /
>- /home
>- /backup
>- /dev
>
> On Friday, March 9, 2018 at 6:52:58 PM UTC+5:30, Thomas Hikade wrote:
>>
>> In addition you might like to print out the name of your FS which is too 
>> big. For that you need the names again in the last debug loop.
>> You could fix that like this, using advanced looping statement 
>> "with_together" (Ansible Loops 
>> 
>> )
>>
>>   vars:
>> filesystems:
>>   - /
>>   - /tmp
>>
>> size_too_big: "20"
>>
>>   tasks:
>>
>> ...
>>
>>   - name: Size is big v2
>> debug:
>>   msg:  "{{ item.1 }} is too big! size={{ item.0 }} "
>> when: item.0 > size_too_big
>> with_together:
>>- "{{ test.results|map(attribute='stdout')|list }}"
>>- "{{ filesystems }}"
>>
>> This will produce the following output:
>>
>> TASK [Size is big v2] 
>> **
>> ok: [demobox] => (item=[u'37', u'/']) => {
>> "item": [
>> "37",
>> "/"
>> ],
>> "msg": "/ is too big! size=37 "
>> }
>> ok: [demobox] => (item=[u'37', u'/tmp']) => {
>> "item": [
>> "37",
>> "/tmp"
>> ],
>> "msg": "/tmp is too big! size=37 "
>> }
>>
>>
>>

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/0700fa18-afc7-43ba-a0d6-d769e3ca8382%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Dynamic Inventory using Google Cloud Platform

2018-03-05 Thread Varun Chopra
Here's a playbook to provision a VM and setup Deluge and a bunch of stuff 
for seedboxes. 
https://gist.github.com/chopraaa/5e34b66b12809261b603a31e7dae

On Monday, March 5, 2018 at 3:10:41 PM UTC+5:30, Chrisy wrote:
>
> Hi Varun,
>
> Thank you...We could get that issue resolved. Can you please give us a 
> sample playbook to install these applications(like apache, python, etc..) 
> in the VM running in the GCP from ansible
>
> Thank You
>
> On Monday, February 26, 2018 at 4:41:43 PM UTC+5:30, Varun Chopra wrote:
>>
>> Keep gce.ini and gce.py in your inventory, make sure gce.ini has values 
>> for gce_service_account_email_address, gce_service_account_pem_file_path 
>> and gce_project_id.
>>
>> After that, gce.py --list-hosts should work.
>>
>> On Monday, February 26, 2018 at 11:30:51 AM UTC+5:30, Chrisy wrote:
>>>
>>> -wall of text-
>>>
>>

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/3a30ee4a-d7ed-4aac-af88-30cac6079ba9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Ansilbe tower install fail

2018-03-05 Thread Varun Chopra
There's no point in making changes to the playbook(s). It's probably an 
issue with your inventory.

On Sunday, March 4, 2018 at 3:47:58 AM UTC+5:30, Abhishek Reddy wrote:
>
>
>

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/7b02d5d7-5fb1-42ad-8fd6-0f5cfa55c767%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: How do I access the cpu %usage in this example? I'm getting an error no matter what I try.

2018-03-05 Thread Varun Chopra
You can access the first element using 
result.ansible_facts.napalm_environment.cpu[0].%usage or so.

On Monday, March 5, 2018 at 1:17:28 PM UTC+5:30, Marcos Georgopoulos wrote:
>
>
>

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/fe419bd7-8cc7-48df-9450-68c8ca87094d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Dynamic Inventory using Google Cloud Platform

2018-02-26 Thread Varun Chopra
Keep gce.ini and gce.py in your inventory, make sure gce.ini has values for 
gce_service_account_email_address, gce_service_account_pem_file_path and 
gce_project_id.

After that, gce.py --list-hosts should work.

On Monday, February 26, 2018 at 11:30:51 AM UTC+5:30, Chrisy wrote:
>
> -wall of text-
>

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/e2b66fed-d183-4b0c-a606-e235d2e73d3c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Playbooks In Subdirectories #12862

2018-02-26 Thread Varun Chopra
> I feel like most people run their Ansible scripts from the Ansible root 
directory and mentally treat that as the directory that Ansible should be 
searching for vars/roles/inventory/etc, _especially_ since the 
`ansible.cfg` is located there.

Your last two years must've been bloody awful. 

On Monday, February 26, 2018 at 12:31:42 PM UTC+5:30, Percy Grunwald wrote:
>
> I've decided to drop my two cents in here as well since I have spent the 
> past hour trawling Google for advice about this issue and found nothing 
> that I consider to be an acceptable solution.
>
> In my opinion, Ansible's behavior when moving playbooks into a 
> subdirectory (but still running them from the root directory) is 
> unintuitive and doesn't seem to match how other programs work. I could 
> enumerate all of the things that stop working, but I think it's sufficient 
> to say that the expected behavior for the majority of people would be as 
> follows:
>
> Given that my directory structure is exactly the same as the layout shown 
> in 
> http://docs.ansible.com/ansible/latest/playbooks_best_practices.html#directory-layout,
>  
> and I am running my scripts from the Ansible root directory like:
>
> ```
> cd /path/to/project/ansible
> ansible-playbook site.yml
> ```
>
> If I copy `site.yml` into any subdirectory of the Ansible root folder:
>
> ```
> mkdir -p playbooks/subdir
> cp site.yml playbooks
> cp site.yml playbook/subdir
> ```
>
> Then the following commands should all be **identical**:
>
> ```
> ansible-playbook site.yml
> ansible-playbook playbooks/site.yml
> ansible-playbook playbooks/subdir/site.yml
> ```
>
> In the 2+ years I have been using Ansible, I haven't encountered a 
> situation where the current default behavior would have been beneficial 
> compared to the behavior I outlined above. I feel like most people run 
> their Ansible scripts from the Ansible root directory and mentally treat 
> that as the directory that Ansible should be searching for 
> vars/roles/inventory/etc, _especially_ since the `ansible.cfg` is located 
> there.
>
> It would be really great if there was a setting that would make Ansible 
> behave in the way I have outlined. I would suggest a boolean variable 
> called something like `lock_working_dir` or `lock_base_dir` that would 
> "lock" Ansible to the `pwd` when searching for vars/roles/inventory/etc.
>
> This would be a huge boon for organization. I'm happy to have a go at this 
> if this is something that would get considered for PR.
>

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/a236b777-d220-485a-8f05-aa2cfa95422c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Firewall Rules Check with Ansible

2018-02-26 Thread Varun Chopra
Yes, the playbook looks up hosts in the inventory file.

On Monday, February 26, 2018 at 3:23:29 AM UTC+5:30, marcalfa1 wrote:
>
> I tried your example and getting the following result.  Is an inventory 
> file needed since all the hosts being defined in the playbook?
>
>
> [WARNING]: Could not match supplied host pattern, ignoring: all
>
>  [WARNING]: provided hosts list is empty, only localhost is available
>
>  [WARNING]: Could not match supplied host pattern, ignoring: HOST1
>
> PLAY [HOST1] 
> skipping: no hosts matched
>
>
> On Thursday, February 22, 2018 at 4:26:38 PM UTC-5, marcalfa1 wrote:
>>
>> I have a firewall with about 50 rules and constantly growing. Is there a 
>> way I can create a playbook to test whether a source host can connect to a 
>> destination host on a specific port?
>> If that is possible I can create a playbook similar to my firewall rules 
>> so next time we make a change to the firewall, I can quickly validate all 
>> the rules using my ansible playbook.
>> Currently, my environment is  Windows and Linux and telnet client is 
>> installed/enabled on every host. 
>>
>>
>>
>>

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/7d7731cc-7b92-43bc-8d82-771e743b48af%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Security acess to a machine via Ansible

2018-02-24 Thread Varun Chopra
You can use Ansible Vault or go with Tower. It has support for teams.

On Thursday, February 22, 2018 at 5:42:24 PM UTC+5:30, Oscar Pinto wrote:
>
> How can I ensure that a user that is used to play the playbooks does not have 
> ssh access in any other way
>
>

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/08205273-1add-4c2f-b722-3b4b6726fc05%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Dynamic Inventory using Google Cloud Platform

2018-02-20 Thread Varun Chopra

>
> 'Invalid authorization response, please check your credentials and time 
> drift.'
>

On Tuesday, February 20, 2018 at 4:21:21 PM UTC+5:30, Chrisy wrote:
>
> We are trying to configure Google compute engine resources using dynamic 
> inventory in ANSIBLE
>
> We are getting the below error when we run the command:  $ ./gce.py --list
>
> File "./gce.py", line 508, in 
> GceInventory()
>   File "./gce.py", line 170, in _init_
> self.driver = self.get_gce_driver()
>   File "./gce.py", line 318, in get_gce_driver
> gce = get_driver(Provider.GCE)(*args, **kwargs)
>   File 
> "/usr/local/lib/python2.7/dist-packages/libcloud/compute/drivers/gce.py", 
> line 1058, in _init_
> self.zone_list = self.ex_list_zones()
>   File 
> "/usr/local/lib/python2.7/dist-packages/libcloud/compute/drivers/gce.py", 
> line 1790, in ex_list_zones
> response = self.connection.request(request, method='GET').object
>   File 
> "/usr/local/lib/python2.7/dist-packages/libcloud/compute/drivers/gce.py", 
> line 120, in request
> response = super(GCEConnection, self).request(*args, **kwargs)
>   File "/usr/local/lib/python2.7/dist-packages/libcloud/common/google.py", 
> line 718, in request
> args, *kwargs)
>   File "/usr/local/lib/python2.7/dist-packages/libcloud/common/base.py", 
> line 748, in request
> params, headers = self.pre_connect_hook(params, headers)
>   File 
> "/usr/local/lib/python2.7/dist-packages/libcloud/compute/drivers/gce.py", 
> line 109, in pre_connect_hook
> headers)
>   File "/usr/local/lib/python2.7/dist-packages/libcloud/common/google.py", 
> line 697, in pre_connect_hook
> self._refresh_oauth2_token()
>   File "/usr/local/lib/python2.7/dist-packages/libcloud/common/google.py", 
> line 772, in _refresh_oauth2_token
> self.oauth2_token = self.oauth2_conn.refresh_token(self.oauth2_token)
>   File "/usr/local/lib/python2.7/dist-packages/libcloud/common/google.py", 
> line 382, in refresh_token
> return self.get_new_token()
>   File "/usr/local/lib/python2.7/dist-packages/libcloud/common/google.py", 
> line 530, in get_new_token
> return self._token_request(request)
>   File "/usr/local/lib/python2.7/dist-packages/libcloud/common/google.py", 
> line 360, in _token_request
> raise GoogleAuthError('Invalid authorization response, please '
> libcloud.common.google.GoogleAuthError: 'Invalid authorization response, 
> please check your credentials and time drift.'
>

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/d565284b-4240-49c2-8e70-ac325d3f5246%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: win_part and win_volume.

2018-02-20 Thread Varun Chopra
Yeah, I agree it wouldn't make sense to put it into a single module. Guess 
I'll keep an eye on that PR.

Thanks.

On Tuesday, February 20, 2018 at 1:29:52 PM UTC+5:30, Jordan Borean wrote:
>
> There are no module right now that can do that for Windows. There was a PR 
> to add a module that did both but due to the complexity it was decided it 
> needed to be split into different modules along the lines of volumes and 
> partitions. This work would need to be done and if you are interested the 
> PR for it is here https://github.com/ansible/ansible/pull/27634.
>
> Thanks
>
> Jordan
>

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/21d39b37-1fa0-4578-85a2-742d2ac3966c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] win_part and win_volume.

2018-02-19 Thread Varun Chopra
Is there a plan to implement modules for cmdlets like *-Partition, *-Volume? 


Or I guess they're already there and I'm missing something. o_O

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/5733b391-318b-4cd7-8cbf-fb65e495fbc0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Installed documentation

2018-02-18 Thread Varun Chopra
How's the day to day user supposed to know this? :/

On Saturday, February 17, 2018 at 3:51:09 AM UTC+5:30, Brian Coca wrote:
>
> FYI, ansible-doc does more than modules, it now documents other 
> plugins also, i.e ansible-doc -t lookup nested 
>
>
> -- 
> -- 
> 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 email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/4a537875-b401-460b-9ee6-06ffd8038bf9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Is it possible to associate a host to a variable?

2018-02-18 Thread Varun Chopra
You can declare variables for individual hosts in tower as well.

On Friday, February 16, 2018 at 10:49:41 AM UTC+5:30, Edson D'Agostini 
wrote:
>
> Greetings,
>
> Would you please let me know if there is a way of associating a host with 
> a variable. In other words,
>
> I have in one test inventory file something like his:
>
> nodenameA nodeNumber=1
> nodenameB nodeNumber=2
> nodenameC nodeNumber=3
>
> This works well when running from the CLI, but as now it is being 
> implemented Ansible Tower, I did not find any reference on guides and 
> forums about this association.
>
> Any thought are welcome to help me find a way out of this association or a 
> way to implement it into Tower.
> Regards,
> Ed
>
>

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/7dddc48e-1d3c-4375-9dcd-bc972db6022f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Using 2 inventories. Can someone explain what I'm doing wrong?

2018-02-13 Thread Varun Chopra
Thanks. I read your post and realized what I did wrong.

/workspace was my working directory and workstation's my hostname. Mixed up 
the two. :l

On Tuesday, February 13, 2018 at 11:08:42 PM UTC+5:30, Vyacheslav wrote:
>
>
> >  Missing (or not readable) key file: '/workstation/gcloud/
> credentials.json'
>
> what says ls -la /workstation/gcloud | grep credentials.json ?
>
>>

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/042e44cf-b1f9-4574-90eb-5881e6cac3ec%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Using 2 inventories. Can someone explain what I'm doing wrong?

2018-02-13 Thread Varun Chopra
So I plan to use a static and a dynamic inventory (gce) and this is what my 
play folder looks like:

.
├── ansible.cfg
├── credentials.json
├── gce_vars
│   ├── auth
│   └── test_servers
├── group_vars
│   └── all
├── hosts.yml
├── inventory
│   ├── gce.ini
│   ├── gce.py
│   └── hosts.yml
└── provision.yml

3 directories, 10 files


credentials.json is the json private key for my service account.

[root@workstation gcloud]# cat gce_vars/auth
---
service_account_email: "x-comp...@developer.gserviceaccount.com"
path_to_credentials: /workspace/gcloud/credentials.json
project_id: "heroic-XXX-XXX"
...

gce.ini

[gce]
libcloud_secrets =
gce_service_account_email_address = X-compute@developer.gserviceaccount.
com
gce_service_account_pem_file_path = /workstation/gcloud/credentials.json
gce_project_id = heroic-XXX-XXX

[inventory]
inventory_ip_type = external

[cache]
cache_path = ~/.ansible/tmp
cache_max_age = 300

However, when I try to run the dynamic inventory, I get this error:

[root@workstation inventory]# ./gce.py --list
Traceback (most recent call last):
  File "./gce.py", line 508, in 
GceInventory()
  File "./gce.py", line 170, in __init__
self.driver = self.get_gce_driver()
  File "./gce.py", line 318, in get_gce_driver
gce = get_driver(Provider.GCE)(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/libcloud/compute/drivers/gce.py", 
line 1795, in __init__
super(GCENodeDriver, self).__init__(user_id, key, **kwargs)
  File "/usr/lib/python2.7/site-packages/libcloud/common/base.py", line 
975, in __init__
self.connection = self.connectionCls(*args, **conn_kwargs)
  File "/usr/lib/python2.7/site-packages/libcloud/compute/drivers/gce.py", 
line 99, in __init__
credential_file=credential_file, **kwargs)
  File "/usr/lib/python2.7/site-packages/libcloud/common/google.py", line 
767, in __init__
user_id, key, auth_type, credential_file, scopes, **kwargs)
  File "/usr/lib/python2.7/site-packages/libcloud/common/google.py", line 
653, in __init__
self.user_id, self.key, self.scopes, **kwargs)
  File "/usr/lib/python2.7/site-packages/libcloud/common/google.py", line 
495, in __init__
"file: '%s'" % key)
ValueError: Missing (or not readable) key file: 
'/workstation/gcloud/credentials.json'


-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/2c046b46-4dc0-46d3-bbd4-b999b27db76d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: ssh connection doesn't work

2018-02-04 Thread Varun Chopra
You need to have Python installed on the managed host.

On Sunday, February 4, 2018 at 6:22:54 PM UTC+5:30, jonatha...@clearsys.re 
wrote:
>
> Hi everybody,
>
> I have some problems to use ansible.
>
>
> I use ansible version 2.4.3.0 i
>
> I testing just one host with IP and port (I have port fowarding).
> I copying ssh pub key (ssh-copy-id).
> I try to install Git on the target serveur. 
> tasks:
> - name: Installation de Git
> apt: name=git update_cache=yes
>
>
> When I lauch ansible (ansible-playbook -i hosts playbook.yml -), I 
> have this message error : 
>
> OpenSSH_6.7p1 Debian-5+deb8u3, OpenSSL 1.0.1t  3 May 2016\r\ndebug1: 
> Reading configuration data /etc/ssh/ssh_config\r\ndebug1: 
> /etc/ssh/ssh_config line 19: Applying options for *\r\ndebug1: auto-mux: 
> Trying existing master\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug2: 
> mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: 
> request forwardings: 0 local, 0 remote\r\ndebug3: 
> mux_client_request_session: entering\r\ndebug3: mux_client_request_alive: 
> entering\r\ndebug3: mux_client_request_alive: done pid = 5417\r\ndebug3: 
> mux_client_request_session: session request sent\r\ndebug1: 
> mux_client_request_session: master session id: 2\r\ndebug3: 
> mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: Received 
> exit status from master 0\r\nShared connection to 165.169.240.98 
> closed.\r\n", 
> "module_stdout": "/bin/sh: 1: /usr/bin/python: not found\r\n"
>
>
> But if I lauch ansible ssh command in the terminal (just copy and paste 
> ansible ssh command : ssh -vvv -C -o ControlMaster=auto -o 
> ControlPersist=60s -o Port=2211 -o KbdInteractiveAuthentication=no -o 
> PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey 
> -o PasswordAuthentication=no -o User=root -o ConnectTimeout=10 -o 
> ControlPath=/home/jrecly/.ansible/cp/d29cd310c0 -tt 165.169.240.98), 
> connection wil be establish normaly
>
>
>
> here the result of the -v ansible-playbook command
> ---
> jrecly@debian:~/ansible$ ansible-playbook -i hosts playbook.yml - 
> ansible-playbook 2.4.3.0
>   config file = /etc/ansible/ansible.cfg
>   configured module search path = 
> [u'/home/jrecly/.ansible/plugins/modules', 
> u'/usr/share/ansible/plugins/modules']
>   ansible python module location = /usr/lib/python2.7/dist-packages/ansible
>   executable location = /usr/bin/ansible-playbook
>   python version = 2.7.9 (default, Jun 29 2016, 13:08:31) [GCC 4.9.2]
> Using /etc/ansible/ansible.cfg as config file
> setting up inventory plugins
> Parsed /home/jrecly/ansible/hosts inventory source with ini plugin
> Loading callback plugin default of type stdout, v2.0 from 
> /usr/lib/python2.7/dist-packages/ansible/plugins/callback/default.pyc
>
> PLAYBOOK: playbook.yml 
> ***
> 1 plays in playbook.yml
>
> PLAY [Securisation des serveurs] 
> *
>
> TASK [Gathering Facts] 
> ***
> Using module_utils file 
> /usr/lib/python2.7/dist-packages/ansible/module_utils/basic.py
> Using module_utils file 
> /usr/lib/python2.7/dist-packages/ansible/module_utils/facts/__init__.py
> Using module_utils file 
> /usr/lib/python2.7/dist-packages/ansible/module_utils/facts/namespace.py
> Using module_utils file 
> /usr/lib/python2.7/dist-packages/ansible/module_utils/facts/ansible_collector.py
> Using module_utils file 
> /usr/lib/python2.7/dist-packages/ansible/module_utils/facts/default_collectors.py
> Using module_utils file 
> /usr/lib/python2.7/dist-packages/ansible/module_utils/_text.py
> Using module_utils file 
> /usr/lib/python2.7/dist-packages/ansible/module_utils/parsing/convert_bool.py
> Using module_utils file 
> /usr/lib/python2.7/dist-packages/ansible/module_utils/parsing/__init__.py
> Using module_utils file 
> /usr/lib/python2.7/dist-packages/ansible/module_utils/pycompat24.py
> Using module_utils file 
> /usr/lib/python2.7/dist-packages/ansible/module_utils/six/__init__.py
> Using module_utils file 
> /usr/lib/python2.7/dist-packages/ansible/module_utils/facts/compat.py
> Using module_utils file 
> /usr/lib/python2.7/dist-packages/ansible/module_utils/facts/timeout.py
> Using module_utils file 
> /usr/lib/python2.7/dist-packages/ansible/module_utils/facts/collector.py
> Using module_utils file 
> 

[ansible-project] Re: ansible conditions

2018-02-04 Thread Varun Chopra
Hi Sudhir,

You're barely making sense and it doesn't help when you don't provide any 
code.

Nobody can help you if they don't understand you.

--
Varun

On Thursday, February 1, 2018 at 9:11:08 PM UTC+5:30, Sudhir Kumar wrote:
>
> Hi,
>
> Below snippet sometimes working and sometimes failing. So, i am executing 
> it with jenkins and idea is that if parameter is defined then script should 
> run otherwise it should not run. 
>
> Can anyone please enlighten me what's wrong ?
>
> #
>   - name: Executing lvm script 
> shell: /tmp/lvm-script.sh sdb {{ vg_name }} {{ mtpt_size }} 
> args:
>   chdir: /tmp/
> when: vg_name is defined
> ##
>

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/c12969fc-c2a3-4900-bc87-f482670918fd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] assert and fail. When to use what?

2018-02-01 Thread Varun Chopra
Hi,

I've been working on a playbook that asserts prerequisites required for a 
mssql installation and I'm not entirely confident with what I've come up 
with.

https://gist.githubusercontent.com/chopraaa/1b74480a7b286ee91dd855ae670104f1/raw/660b758b4e82e0b68e6fe73946d005cfcac9/mssql.yml

What I know is that if an assert is false, it fails the playbook, and the 
same can be done using the fail module. So what's the difference between 
the two?

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/d691aec9-82e2-4061-afeb-ad61cc47bd8f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Item name in task name.

2018-02-01 Thread Varun Chopra
Yeah, you're right!

Thanks!

On Thursday, February 1, 2018 at 3:56:32 AM UTC+5:30, Malcolm 
Hussain-Gambles wrote:
>
> I don't think you can do that, as the item isn't defined when it prints 
> the name section. I also seem to remember that certain modules,like yum 
> will process the list in one go. Rather than doing two yum installs.

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/1d8272c7-71a4-43e0-ab7e-3bf6a5f1de63%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Item name in task name.

2018-02-01 Thread Varun Chopra
This doesn't matter.

On Thursday, February 1, 2018 at 1:37:49 AM UTC+5:30, ZillaYT wrote:
>
> Try enclosing the name in double-quotes, e.g.,
>
>   tasks:
> - name: "Installing {{ item }}"
>   yum:
> name: "{{ item }}"
> state: latest
>   with_items:
> - httpd
> - firewalld
>
>
> On Monday, January 29, 2018 at 11:02:58 AM UTC-5, Varun Chopra wrote:
>>
>> Hi,
>>
>> I'm trying to display the item name in the name of the task but it 
>> doesn't work as intended.
>>
>> Here's part of my play:
>>
>>   tasks:
>> - name: Installing {{ item }}
>>   yum:
>> name: "{{ item }}"
>> state: latest
>>   with_items:
>> - httpd
>> - firewalld
>>
>> This is what I get when I run the play:
>>
>> TASK [Installing {{ item }}] 
>> **
>> ok: [servera.example.com] => (item=[u'httpd', u'firewalld'])
>>
>> Is this supposed to work this way? I
>>
>>

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/babbaf31-78b6-47be-a91b-96709c77edab%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: requests-credssp and credentials encryprion at first hop.

2018-01-30 Thread Varun Chopra
There was a recent post on Reddit about this...

Here it is: 
https://www.reddit.com/r/PowerShell/comments/7qra9r/double_hop_solvers_and_resourcebased_kerberos/

CredSSP isn't really the best way to go about this. And I think this post 
should go on Git as Ansible needs a better way to cover double-hops.

On Tuesday, January 30, 2018 at 3:13:46 PM UTC+5:30, Павел Полушин wrote:
>
> Hello. 
> I have security-related question.
> In our environment we use ansible for application deployment. Ansible 
> playbooks running by jenkins.
> Scope for deployment contains Windows-based servers (2008R2+).
> In some cases we are facing with "double-hop" problem when passing 
> credentials is needed.
> CredSSP is intended to solve problems like this but it's insecure (
> http://www.powershellmagazine.com/2014/03/06/accidental-sabotage-beware-of-credssp/
> ).
> In common cases, credentials are being sent in clear text. Here is picture 
> http://www.powershellmagazine.com/wp-content/uploads/2014/03/image001.png/
>
> I'm interested, is this problem solved in requests-credssp module? 
> (Credentials are stored from jenkins. Ansible connects to servers using 
> https.)
> Does anyone tried to investigate it?
>
>

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/babf2969-bb33-4e49-a411-082dd4b5de17%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Item name in task name.

2018-01-29 Thread Varun Chopra
Hi,

I'm trying to display the item name in the name of the task but it doesn't 
work as intended.

Here's part of my play:

  tasks:
- name: Installing {{ item }}
  yum:
name: "{{ item }}"
state: latest
  with_items:
- httpd
- firewalld

This is what I get when I run the play:

TASK [Installing {{ item }}] 
**
ok: [servera.example.com] => (item=[u'httpd', u'firewalld'])

Is this supposed to work this way? I

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/ab214dc8-2ee7-4f39-8925-0b18bd03b1c5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: [Windows] Install visual studio

2018-01-28 Thread Varun Chopra
Yes, and?

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/ab52b6af-c159-49f8-9507-72f0654eab0c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] How to display ansible_host in console output even if an alias is defined at inventory level

2018-01-28 Thread Varun Chopra
I think it's best to reserve ansible_host as the IP address as that remains 
constant. You can declare friendly names first that way:

jboss_1 ansible_host=10.0.0.10

Going by your method, your inventory will require a lot of upkeep because if 
the hostname changes, the inventory will break.

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/a02a1678-40c8-4292-ad5b-6272508aac12%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] service module fails to start nginx usig a docker connection

2018-01-28 Thread Varun Chopra
Run both using - and post the outputs here.

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/58ceb438-bfca-4e6e-bb0e-a2490c2effb8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: [Windows] Install visual studio

2018-01-28 Thread Varun Chopra
That's not how become works. You can set become: yes at the task and play 
level, not module level.

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/77463337-021c-4596-8e26-0196f2069654%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.