Re: [ansible-project] error creating a directory

2021-06-24 Thread Rahul Puli
Can you try the one below?

---
- hosts: all
  tasks:
  - name: Create Directory if not exist
win_file:
 path: c:\temp
 state: directory


On Tue, Jun 22, 2021 at 7:08 AM zil...@gmail.com  wrote:

> Try c:\\temp as path, like this
>
> ---
> - name: testing win_get_url
>   hosts: all
>   tasks:
> - name: Create Directory if not exist
>   win_file:
> path: c:\\temp
> state: directory
>
>
> On Sunday, June 28, 2020 at 11:15:45 PM UTC-4 om.nac...@gmail.com wrote:
>
>> Run the playbook with the administrator access or grant required access
>> to "adm-tkw" to create dir under C:\\.
>>
>>
>> And as per the example on win_file ansible doc
>> 
>> its Temp, not temp.
>>
>> On Sun, Jun 28, 2020 at 11:59 PM Tony Wong  wrote:
>>
>>> is it the Capital C?
>>>
>>> just tied and same error
>>>
>>> On Sun, Jun 28, 2020 at 11:03 AM Tej Singh Rana 
>>> wrote:
>>>
 You have to use --> path: C:\temp

 On Sun, Jun 28, 2020 at 11:20 PM Tony Wong  wrote:

> ---
> - name: testing win_get_url
>   hosts: all
>   tasks:
> - name: Create Directory if not exist
>   win_file:
> path: c:\temp
> state: directory
>
>
> TASK [Create Directory if not exist]
> **
> task path: /home/tony/windows/download.yml:5
> Using module file
> /usr/lib/python2.7/dist-packages/ansible/modules/windows/win_file.ps1
> Pipelining is enabled.
>  ESTABLISH WINRM CONNECTION FOR USER: adm-tkw@on PORT
> 5986 TO devsp2016
> EXEC (via pipeline wrapper)
> fatal: [devsp2016]: FAILED! => {
> "changed": false,
> "msg": "path c:\\temp is not a directory"
>
>
> any idea why I cannot create the directory?
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/CALmkhkpu7K4k0u27d3kXtNtAziRfXztXKM8e%3DggoqwhaShCtuw%40mail.gmail.com
> 
> .
>
 --
 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 view this discussion on the web visit
 https://groups.google.com/d/msgid/ansible-project/CADBoQTrs%3DQDJfYNhUaxgc%3D3SfGktW07qTWCRguYEr5UFemDV4w%40mail.gmail.com
 
 .

>>> --
>>> 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 view this discussion on the web visit
>>> https://groups.google.com/d/msgid/ansible-project/CALmkhkrHp2B%2BgytHxQv7EZjzcU7P8vubzxRWxZw9vOq182jXLg%40mail.gmail.com
>>> 
>>> .
>>>
>> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/f83f511a-8452-46f0-bce6-ac8ff1933d18n%40googlegroups.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAK8vF9KDJrPqnB_XyXxq3Re4gFCmELYnwG2uunG4Uo1BiGe%3DeA%40mail.gmail.com.


Re: [ansible-project] Ansible windows unzip module is failing, how to fix that?

2020-10-22 Thread Rahul Puli
 Try to update the below one in your inventory file and try to execute

ansible_winrm_server_cert_validation=ignore


or


Update the pywinrm and check again.


On Sat, Oct 17, 2020 at 12:53 AM uday kiran  wrote:

> My task part of playbook.
> - name: unzip maven
>   win_unzip:
>  src: C:\tools\maven.zip
> dest: C:\tools\maven
> recurse: yes
> delete_archive: yes
>
> output:
> TASK [unzip maven]
> ***
> [WARNING]: ansible_winrm_cert_validation unsupported by pywinrm (is an
> up-to-date version of pywinrm installed?) [WARNING]:
> ansible_winrm_cert_validation unsupported by pywinrm (is an up-to-date
> version of pywinrm installed?) fatal: [build-machine3]: FAILED! =>
> {"changed": false, "dest": "C:\\tools\\maven", "msg":
> "PowerShellCommunityExtensions PowerShell Module (PSCX) is required for
> non-'.zip' compressed archive types.", "removed": false, "src":
> "C:\\tools\\maven.zip"} fatal: [build-machine2]: FAILED! => {"changed":
> false, "dest": "C:\\tools\\maven", "msg": "PowerShellCommunityExtensions
> PowerShell Module (PSCX) is required for non-'.zip' compressed archive
> types.", "removed": false, "src": "C:\\tools\\maven.zip"}
>
> So added the PSCX part before it.
> - name: Install PSCX
>   win_psmodule:
>  name: Pscx
>  state: present
>
> But, got below error now related to Pscx.
> TASK [Install PSCX]
> **
> [WARNING]: ansible_winrm_cert_validation unsupported by pywinrm (is an
> up-to-date version of pywinrm installed?) [WARNING]:
> ansible_winrm_cert_validation unsupported by pywinrm (is an up-to-date
> version of pywinrm installed?) fatal: [build-machine3]: FAILED! =>
> {"changed": false, "msg": "Problems installing Pscx module: The following
> commands are already available on this
> system:'gcb,Expand-Archive,Format-Hex,Get-Hash,help,prompt,Get-Clipboard,Get-Help,Set-Clipboard'.
> This module 'Pscx' may override the existing commands. If you still want to
> install this module 'Pscx', use -AllowClobber parameter.", "nuget_changed":
> false, "output": "", "repository_changed": false} fatal: [build-machine2]:
> FAILED! => {"changed": false, "msg": "Problems installing Pscx module: The
> following commands are already available on this
> system:'gcb,Expand-Archive,Format-Hex,Get-Hash,help,prompt,Get-Clipboard,Get-Help,Set-Clipboard'.
> This module 'Pscx' may override the existing commands. If you still want to
> install this module 'Pscx', use -AllowClobber parameter.", "nuget_changed":
> false, "output": "", "repository_changed": false}
>
> Please suggest.
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/25dda712-3f60-4755-a5b7-180f3af45bdcn%40googlegroups.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAK8vF9Lk8ZEz%2B9nokY4yXLrmcG6JE5hvKp9-EcWWN3X4ZaB6Hg%40mail.gmail.com.


Re: [ansible-project] Conditionally input to a playbook based on vars_prompt

2020-10-22 Thread Rahul Puli
Yes, this can be achievable. You can use when condition.


On Thu, Oct 22, 2020 at 11:59 AM Sobhan Anavarapu <
sobhan.anavar...@gmail.com> wrote:

> I have a question, with optional input of A or B in vars_prompt can the
> command be executed in a playbook task.
>
>  example
> - name: checking the switchshow
>value_command:
>command_set:
> - command: switchdisable
> - command: switchshow
>
> Like with vars_prompt if we select A 1st command need to execute if B
> second command need to execute
>
> Can this be achieved with Ansible ?
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/b134e188-0ad0-488e-b8a3-fe66a42350a6n%40googlegroups.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAK8vF9Jzid7pMjs7riPdqryvTUAuobsfbQ8V7pqMeFLoVfFoKA%40mail.gmail.com.


Re: [ansible-project] Branching/conditional statements to install different editions and versions of MS SQL Server

2020-09-24 Thread Rahul Puli
Solved the issue using when conditions for the plays and it perfectly.
Install MSSQL version and edition depends on the user input (vars_prompt)
on the target machine.

---
# tasks file for mssql

- include: download_sqlexpress2012.yml
  when: sql_version == "2012" and sql_release == "exp"

- include: download_sqlexpress2014.yml
  when: sql_version == "2014" and sql_release == "exp"

- include: download_sqlexpress2016.yml
  when: sql_version == "2016" and sql_release == "exp"

- include: download_sqlexpress2017.yml
  when: sql_version == "2017" and sql_release == "exp"

- include: download_sqlexpress2019.yml
  when: sql_version == "2019" and sql_release == "exp"

- include: extract_sqlexpress_setup.yml
  when: sql_release == "exp"

- include: mssql_exp_configuration_file.yml
  when: sql_release == "exp"

- include: run_mssql_exp_setup.yml
  when: sql_release == "exp"


  # MSSQL DEVELOPER -

- include: download_mssql_2014_developer.yml
  when: sql_version == "2014" and sql_release == "dev"

- include: download_mssql_2016_developer.yml
  when: sql_version == "2016" and sql_release == "dev"

- include: download_mssql_2017_developer.yml
  when: sql_version == "2017" and sql_release == "dev"

- include: download_mssql_2019_developer.yml
  when: sql_version == "2019" and sql_release == "dev"


On Thu, Sep 10, 2020 at 8:21 PM Rahul puli  wrote:

> Hello,
>
> I have created a role to install MSSQL for different versions
> (2014,2016,2017,2019) and its working fine for all the versions.
>
> For installing MS SQL 2014 developer version I need to comment the others
> developer versions in main.yml file and need to change the product ID
> (mssql/tasks/run_mssql_setup.yml).
>
> Is there any other solution where I can use branching/conditional
> statements to install different editions and versions of MS SQL Server
> without commenting the other version in main.yml file.
>
>
>
> Below is the main.yml file which looks.
>
> # tasks file for mssql
>
> ---
>
> - include: createtemporaryfolder.yml
>
> - include: install_dotnet3.5.yml
>
> - include: install_dotnet4.5.yml
>
>
>
> # MSSQL DEVELOPER -
>
>
>
> - include: download_mssql_2014_developer.yml
>
> #- include: download_mssql_2016_developer.yml
>
> #- include: download_mssql_2017_developer.yml
>
> #- include: download_mssql_2019_developer.yml
>
> .
>
> .
>
> .
>
>
>
>
>  You can get see the role from the below link
>
> https://github.com/rahulpuli/Install-MSSQL-Devloper-edition-using-Ansible
>
>
> Thanks,
>
> Rahul
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/3ca0f81f-3c3a-48a9-9ddf-61f96f0faf0an%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/3ca0f81f-3c3a-48a9-9ddf-61f96f0faf0an%40googlegroups.com?utm_medium=email_source=footer>
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAK8vF9Kg9kUix0nCeMy_8NKvQ3i8q5zzAnRo8QSsYzwViqy4kg%40mail.gmail.com.


[ansible-project] Re: Copy module error in windows

2020-09-16 Thread Rahul Puli
Hello Rubod,

Please try to run the below code and check.

--- 
- name: "Copy Files" 
hosts: all 

tasks: 
- name: Copy Files 
win_copy: 
  src: C:\abc.txt 
  dest: C:\ansible\abc.txt 

On Wednesday, September 16, 2020 at 6:17:13 PM UTC+5:30 rubod...@gmail.com 
wrote:

> HI Team,
>
> please help me in this as i'm very new to this , i'm getting this
> error while testing the simple windows file copy module through awx.
>
> Ansible VM is on Azure
> Target Windows machine is also on Azure - No network restrictions as
> this is a POC project
>
> playbook :
>
> ---
> - name: "Copy Files"
> hosts: all
>
> tasks:
> - name: Copy Files
> win_copy:
> remote_src: C:\abc.txt
> remote_dest: C:\ansible\abc.txt
>
>
>
> error :
>
> {
> "src": null,
> "dest": null,
> "msg": "src (or content) and dest are required",
> "_ansible_no_log": false,
> "changed": false
> }
>
>
> Any help is appreciated.
>
> Thanks
>
> Rubod
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/f508c5c1-68b7-43f4-a7fd-7dd2712a6f94n%40googlegroups.com.


[ansible-project] Branching/conditional statements to install different editions and versions of MS SQL Server

2020-09-10 Thread Rahul puli
 

Hello,

I have created a role to install MSSQL for different versions 
(2014,2016,2017,2019) and its working fine for all the versions. 

For installing MS SQL 2014 developer version I need to comment the others 
developer versions in main.yml file and need to change the product ID 
(mssql/tasks/run_mssql_setup.yml).

Is there any other solution where I can use branching/conditional 
statements to install different editions and versions of MS SQL Server 
without commenting the other version in main.yml file.

 

Below is the main.yml file which looks.

# tasks file for mssql

---

- include: createtemporaryfolder.yml

- include: install_dotnet3.5.yml 

- include: install_dotnet4.5.yml

 

# MSSQL DEVELOPER -

 

- include: download_mssql_2014_developer.yml

#- include: download_mssql_2016_developer.yml

#- include: download_mssql_2017_developer.yml 

#- include: download_mssql_2019_developer.yml

.

.

.




 You can get see the role from the below link

https://github.com/rahulpuli/Install-MSSQL-Devloper-edition-using-Ansible


Thanks,

Rahul

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/3ca0f81f-3c3a-48a9-9ddf-61f96f0faf0an%40googlegroups.com.