[ansible-project] Re: Ansible remote installation of SQL server 2016.

2018-03-21 Thread 12177589
I think it might be Windows rights again.

-- 
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/99924fc3-8a35-43af-89e6-cd03642bc52e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Ansible remote installation of SQL server 2016.

2018-03-21 Thread 12177589
hello everybodyDuring the installation of SQL server 2016, I encountered 
some problems:
1.In ansible, when deployed with ‘raw’, background hint: This SQL Server 
setup media does not support the language of the OS;
When you deploy with ‘win_command‘, the installation error, log tip: 
the installer fails when the job UpdateResult is running.
But it's okay to run directly on Windows CMD.Windows is Chinese and 
ansible is English.
2.How does ansible decompress the iso file format?

As follows,thinks:









-- 
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/0ea61495-a660-4bdc-b2d7-020eeae2e8c3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Playbook ignores attributes auth_pass\authorize and wont enter privilege mode.

2018-03-21 Thread igor
Hi Everyone!

I am new to "Ansible". I've created a playbook that backups cisco running 
config. My problem is that i get an error Invalid input detector "^" i did 
some digging and its alerting due to the command not running in privileged 
mode. I've tried using authorize and auth_pass and it gives me an error 
saying :

   [WARNING]: Ignoring invalid attribute: username

 [WARNING]: Ignoring invalid attribute: authorize

 [WARNING]: Ignoring invalid attribute: auth_pass

 [WARNING]: Ignoring invalid attribute: host

here is playbook:

---
- hosts: myswitches
  gather_facts: true
  connection: local

  tasks:
   - name: show run
 ios_command:
   commands:
   - show run
 host: "{{ inventory_hostname }}"
 auth_pass: cisco
 username: cisco
 password: cisco
 authorize: yes
 #provider:
 #  authorize: yes
 #  auth_pass: cisco
 #register: config

   - name: save output to /etc/ansible/backups
 copy:
   content: "{{ config.stdout[0] }}"
   dest: "/etc/ansible/backups/show_run_{{ inventory_hostname }}.txt"


here is - outcome:


ansible-playbook backups_test.yml -
ansible-playbook 2.4.3.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = 
[u'/home/techops/.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.12 (default, Nov 20 2017, 18:23:56) [GCC 5.4.0 
20160609]
Using /etc/ansible/ansible.cfg as config file
setting up inventory plugins
Set default localhost to 127.0.0.1
Parsed /etc/ansible/hosts inventory source with ini plugin
 [WARNING]: Ignoring invalid attribute: username

 [WARNING]: Ignoring invalid attribute: authorize

 [WARNING]: Ignoring invalid attribute: auth_pass

 [WARNING]: Ignoring invalid attribute: host

Loading callback plugin default of type stdout, v2.0 from 
/usr/lib/python2.7/dist-packages/ansible/plugins/callback/default.pyc

PLAYBOOK: backups_test.yml 
**
1 plays in backups_test.yml

PLAY [myswitches] 
***

TASK [Gathering Facts] 
**
Using module file 
/usr/lib/python2.7/dist-packages/ansible/modules/system/setup.py
<10.175.0.238> ESTABLISH LOCAL CONNECTION FOR USER: root
<10.175.0.238> EXEC /bin/sh -c '/usr/bin/python && sleep 0'
Using module file 
/usr/lib/python2.7/dist-packages/ansible/modules/system/setup.py
<10.175.0.234> ESTABLISH LOCAL CONNECTION FOR USER: root
<10.175.0.234> EXEC /bin/sh -c '/usr/bin/python && sleep 0'
ok: [10.175.0.234]
ok: [10.175.0.238]
META: ran handlers

TASK [show run] 
*
task path: /etc/ansible/playbooks/backups_test.yml:7
<10.175.0.238> using connection plugin network_cli
<10.175.0.234> using connection plugin network_cli
<10.175.0.238> socket_path: /home/techops/.ansible/pc/3b9c1a1e70
<10.175.0.234> socket_path: /home/techops/.ansible/pc/606d5c5780
Using module file 
/usr/lib/python2.7/dist-packages/ansible/modules/network/ios/ios_command.py
Using module file 
/usr/lib/python2.7/dist-packages/ansible/modules/network/ios/ios_command.py
<10.175.0.238> ESTABLISH LOCAL CONNECTION FOR USER: root
<10.175.0.238> EXEC /bin/sh -c '/usr/bin/python && sleep 0'
<10.175.0.234> ESTABLISH LOCAL CONNECTION FOR USER: root
<10.175.0.234> EXEC /bin/sh -c '/usr/bin/python && sleep 0'
failed: [10.175.0.238] (item=OVuq7syghNs824LrXc7d) => {
"changed": false,
"invocation": {
"module_args": {
"auth_pass": null,
"authorize": null,
"commands": [
"show run"
],
"host": null,
"interval": 1,
"match": "all",
"password": null,
"port": null,
"provider": null,
"retries": 10,
"ssh_keyfile": null,
"timeout": null,
"username": null,
"wait_for": null
}
},
"item": "OVuq7syghNs824LrXc7d",
"msg": "show run\r\n^\r\n% Invalid input detected 
at '^' marker.\r\n\r\nATL-INT-SW-09>",
"rc": 1
}
failed: [10.175.0.234] (item=OVuq7syghNs824LrXc7d) => {
"changed": false,
"invocation": {
"module_args": {
"auth_pass": null,
"authorize": null,
"commands": [
"show run"
],
"host": 

[ansible-project] blockinfile: content="{{ item.content }}" -- Making it pretty

2018-03-21 Thread John Harmon
I have the following which works. However, I would like to make the bash 
script code "pretty".  It is found under the "content" section of the 
with_items.  How can I do this?

- name: Ensure myscript.sh contains directory checks
  blockinfile:
dest: "/home/{{ user.stdout }}/Scripts/myscript.sh"
insertafter: "{{ item.regexp }}"
marker: "## {mark} added by Ansible - {{ item.define }}"
content: "{{ item.content }}"
  with_items:
- { regexp: "^trap.*exit\ 1.*1\ 2\ 3\ .*", define: "Check for 
/interface", content: "if [ -f /interface/ ]; then echo 'The 
/interface/$NATU directory is missing, aborting!'; exit 1; fi" }
- { regexp: "^NATU.*interface.*grep\ natu.*", define: "Check for 
/interface/natu", content: "if [ -f /interface/$NATU ]; then echo 'The 
/interface/$NATU directory is missing, aborting!'; exit 1; fi" }


I want to have the content injected into the file as follows (which can 
easily be done without a loop, but I wish to do this within the loop):
if [ -f /interface/ ]; then
  echo 'The /interface/$NATU directory is missing, aborting!'
  exit 1
fi

Thanks in advance!

-- 
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/5b42baa3-2134-4eff-b090-fab378126ab0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Ansible installation issue - Makefile

2018-03-21 Thread Andreas Olsson
ons 2018-03-21 klockan 06:40 -0700 skrev Camille Beaudou:
> I'm trying to install Ansible on a Ubuntu 16.04 VM (VMWare). I'm
> following the install instruction on Ansible website, however when
> executing the command "make rpm", i get the following error message
> ...

How did you end up at those install instructions?

For an Ubuntu 16.04 system, unless you have any special requirements,
you are likely best of installing from the Ansible PPA.

  
https://docs.ansible.com/ansible/latest/intro_installation.html#latest-releases-via-apt-ubuntu

// Andreas

-- 
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/1521658559.3710.2.camel%40arrakis.se.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] exception: mapping values are not allowed in this context

2018-03-21 Thread Matt Martz
`import_playbook` cannot be used within a play.  Your play starts with `-
hosts: "{{ host }}"`.  Your `import_playbook` would need to come either
before that, or after your `fail` task.

Maybe you are looking for `import_tasks` instead?

On Wed, Mar 21, 2018 at 10:53 AM, John Harmon 
wrote:

> I have the following playbook.  If I comment out the line for
> import_playbook, the error goes away.  Can anybody see what is wrong with
> this?  I am guessing a syntax error, but I can't seem to find it.  Thanks
> in advance!:
>
> ---
> - hosts: "{{ host }}"
>   gather_facts: false
>   tasks:
>
> - import_playbook: update_gitlab_scripts.yml
>
> - name: "Check tcp tuning settings"
>   shell: "/home/gomer/scripts/check_tcp_tuning.sh"
>   no_log: true
>   register: results
>
> - fail:
> msg: "TCP Tuning needed for {{ ansible_hostname }}"
>   when: results.rc > 0
>
> ERROR:
> ERROR! Syntax Error while loading YAML.
>
>
> The error appears to have been in '/etc/ansible/playbooks/
> checks/check_tcp_tuning.yml': line 8, column 11, but may
> be elsewhere in the file depending on the exact syntax problem.
>
> The offending line appears to be:
>
>
> - name: "Check tcp tuning settings"
>   ^ here
>
> exception type: 
> exception: mapping values are not allowed in this context
>   in "", line 8, column 11
>
>
> --
> 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/c958ac69-cc85-4308-a941-5bacb4cb101d%40googlegroups.
> com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Matt Martz
@sivel
sivel.net

-- 
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/CAD8N0v9daQsJ%2BNr_m4y7v2StbrUEzL6KU-VWYUbm65%3DQzk2DFw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] exception: mapping values are not allowed in this context

2018-03-21 Thread John Harmon
Matt, thank you.  I wasn't aware of import_tasks, but it does what I want 
it to do.  Thanks again!

-- 
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/8569fcdc-40ed-45b5-89a5-7d762550dc5d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] exception: mapping values are not allowed in this context

2018-03-21 Thread John Harmon
I have the following playbook.  If I comment out the line for 
import_playbook, the error goes away.  Can anybody see what is wrong with 
this?  I am guessing a syntax error, but I can't seem to find it.  Thanks 
in advance!:

---
- hosts: "{{ host }}"
  gather_facts: false
  tasks:

- import_playbook: update_gitlab_scripts.yml

- name: "Check tcp tuning settings"
  shell: "/home/gomer/scripts/check_tcp_tuning.sh"
  no_log: true
  register: results

- fail:
msg: "TCP Tuning needed for {{ ansible_hostname }}"
  when: results.rc > 0

ERROR:
ERROR! Syntax Error while loading YAML.


The error appears to have been in 
'/etc/ansible/playbooks/checks/check_tcp_tuning.yml': line 8, column 11, 
but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:


- name: "Check tcp tuning settings"
  ^ here

exception type: 
exception: mapping values are not allowed in this context
  in "", line 8, column 11


-- 
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/c958ac69-cc85-4308-a941-5bacb4cb101d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Ansible installation issue - Makefile

2018-03-21 Thread Camille Beaudou
Hi all,

I'm trying to install Ansible on a Ubuntu 16.04 VM (VMWare). I'm following 
the install instruction on Ansible website, however when executing the 
command "make rpm", i get the following error message : 

make[1]: *** [docs/man/man1/ansible-vault.1] Error 1
rm docs/man/man1/ansible-vault.1.asciidoc
make[1]: Leaving directory '/home/camille/ansible'
Makefile:355: recipe for target 'docs' failed
make: *** [docs] Error 2



I guess the error comes from this line of the file Makefile :
docs: generate_asciidoc
make $(MANPAGES)


When i comment those 2 lines, however, i get a similar error with an other 
"make ...".

Do you have any clue about this issue ?

-- 
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/674873d2-1f54-450c-a153-714eee7654db%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Ansible Installation Issue on Linux

2018-03-21 Thread SHR
RedHat 7

On Wednesday, March 21, 2018 at 6:00:16 PM UTC+5:30, Daley Okuwa wrote:
>
> hi,
>
> What flavour of unix are you working on and what version
>
>
> On Wednesday, March 21, 2018 at 11:28:00 AM UTC, SHR wrote:
>
>> I  did installation using epel. So does that mean i have to reinstall 
>> using different epel rpm.
>>
>>
>> On Wednesday, March 21, 2018 at 3:49:22 PM UTC+5:30, Daley Okuwa wrote:
>>>
>>> hi,
>>>
>>> I think it requires a python module
>>> I mean the python module is missing
>>> I advise please reinstall again and check if the correct python module  
>>> is installed
>>>
>>> On Wednesday, March 21, 2018 at 9:57:56 AM UTC, SHR wrote:
>>>
 Hi All,

   M getting below error message after ansible installation. Is this 
 error can be ignorable:

 "
 [root@Test0 Desktop]# ansible --version
 ERROR! Unexpected Exception, this is probably a bug: (pyasn1 0.1.6 
 (/usr/lib/python2.7/site-packages), Requirement.parse('pyasn1>=0.1.7'))
 the full traceback was:

 Traceback (most recent call last):
   File "/usr/bin/ansible", line 85, in 
 mycli = getattr(__import__("ansible.cli.%s" % sub, 
 fromlist=[myclass]), myclass)
   File "/usr/lib/python2.7/site-packages/ansible/cli/__init__.py", line 
 38, in 
 from ansible.inventory.manager import InventoryManager
   File "/usr/lib/python2.7/site-packages/ansible/inventory/manager.py", 
 line 29, in 
 from ansible.inventory.data import InventoryData
   File "/usr/lib/python2.7/site-packages/ansible/inventory/data.py", 
 line 29, in 
 from ansible.plugins.cache import FactCache
   File 
 "/usr/lib/python2.7/site-packages/ansible/plugins/cache/__init__.py", line 
 30, in 
 from ansible.plugins.loader import cache_loader
   File "/usr/lib/python2.7/site-packages/ansible/plugins/loader.py", 
 line 22, in 
 from ansible.parsing.plugin_docs import read_docstring
   File 
 "/usr/lib/python2.7/site-packages/ansible/parsing/plugin_docs.py", line 
 12, 
 in 
 from ansible.parsing.yaml.loader import AnsibleLoader
   File 
 "/usr/lib/python2.7/site-packages/ansible/parsing/yaml/loader.py", line 
 30, 
 in 
 from ansible.parsing.yaml.constructor import AnsibleConstructor
   File 
 "/usr/lib/python2.7/site-packages/ansible/parsing/yaml/constructor.py", 
 line 29, in 
 from ansible.parsing.vault import VaultLib
   File 
 "/usr/lib/python2.7/site-packages/ansible/parsing/vault/__init__.py", line 
 45, in 
 from cryptography.hazmat.backends import default_backend
   File 
 "/usr/lib64/python2.7/site-packages/cryptography/hazmat/backends/__init__.py",
  
 line 7, in 
 import pkg_resources
   File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 3011, 
 in 
 parse_requirements(__requires__), Environment()
   File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 630, 
 in resolve
 raise VersionConflict(dist,req) # XXX put more info here
 VersionConflict: (pyasn1 0.1.6 (/usr/lib/python2.7/site-packages), 
 Requirement.parse('pyasn1>=0.1.7'))

 "

>>>

-- 
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/0d5c6f90-2bf9-489b-a1ee-c65420c3dc39%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Ansible Installation Issue on Linux

2018-03-21 Thread 'Daley Okuwa' via Ansible Project
hi,

What flavour of unix are you working on and what version


On Wednesday, March 21, 2018 at 11:28:00 AM UTC, SHR wrote:

> I  did installation using epel. So does that mean i have to reinstall 
> using different epel rpm.
>
>
> On Wednesday, March 21, 2018 at 3:49:22 PM UTC+5:30, Daley Okuwa wrote:
>>
>> hi,
>>
>> I think it requires a python module
>> I mean the python module is missing
>> I advise please reinstall again and check if the correct python module  
>> is installed
>>
>> On Wednesday, March 21, 2018 at 9:57:56 AM UTC, SHR wrote:
>>
>>> Hi All,
>>>
>>>   M getting below error message after ansible installation. Is this 
>>> error can be ignorable:
>>>
>>> "
>>> [root@Test0 Desktop]# ansible --version
>>> ERROR! Unexpected Exception, this is probably a bug: (pyasn1 0.1.6 
>>> (/usr/lib/python2.7/site-packages), Requirement.parse('pyasn1>=0.1.7'))
>>> the full traceback was:
>>>
>>> Traceback (most recent call last):
>>>   File "/usr/bin/ansible", line 85, in 
>>> mycli = getattr(__import__("ansible.cli.%s" % sub, 
>>> fromlist=[myclass]), myclass)
>>>   File "/usr/lib/python2.7/site-packages/ansible/cli/__init__.py", line 
>>> 38, in 
>>> from ansible.inventory.manager import InventoryManager
>>>   File "/usr/lib/python2.7/site-packages/ansible/inventory/manager.py", 
>>> line 29, in 
>>> from ansible.inventory.data import InventoryData
>>>   File "/usr/lib/python2.7/site-packages/ansible/inventory/data.py", 
>>> line 29, in 
>>> from ansible.plugins.cache import FactCache
>>>   File 
>>> "/usr/lib/python2.7/site-packages/ansible/plugins/cache/__init__.py", line 
>>> 30, in 
>>> from ansible.plugins.loader import cache_loader
>>>   File "/usr/lib/python2.7/site-packages/ansible/plugins/loader.py", 
>>> line 22, in 
>>> from ansible.parsing.plugin_docs import read_docstring
>>>   File 
>>> "/usr/lib/python2.7/site-packages/ansible/parsing/plugin_docs.py", line 12, 
>>> in 
>>> from ansible.parsing.yaml.loader import AnsibleLoader
>>>   File 
>>> "/usr/lib/python2.7/site-packages/ansible/parsing/yaml/loader.py", line 30, 
>>> in 
>>> from ansible.parsing.yaml.constructor import AnsibleConstructor
>>>   File 
>>> "/usr/lib/python2.7/site-packages/ansible/parsing/yaml/constructor.py", 
>>> line 29, in 
>>> from ansible.parsing.vault import VaultLib
>>>   File 
>>> "/usr/lib/python2.7/site-packages/ansible/parsing/vault/__init__.py", line 
>>> 45, in 
>>> from cryptography.hazmat.backends import default_backend
>>>   File 
>>> "/usr/lib64/python2.7/site-packages/cryptography/hazmat/backends/__init__.py",
>>>  
>>> line 7, in 
>>> import pkg_resources
>>>   File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 3011, 
>>> in 
>>> parse_requirements(__requires__), Environment()
>>>   File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 630, in 
>>> resolve
>>> raise VersionConflict(dist,req) # XXX put more info here
>>> VersionConflict: (pyasn1 0.1.6 (/usr/lib/python2.7/site-packages), 
>>> Requirement.parse('pyasn1>=0.1.7'))
>>>
>>> "
>>>
>>

-- 
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/12edd97b-efd4-45b6-be07-b0ee2519d7fd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] napalm-ansible...NXOS

2018-03-21 Thread Peter Sprygada
The NAPALM library does not support connecting to NXOS devices using SSH,
only NXAPI.If you want to connect using SSH, I would recommend using
the nxos core modules instead.

On Tue, Mar 20, 2018 at 11:01 PM Sunil6057  wrote:

> hi
>
> ---
> - hosts: leaf
>   connection: local
>   tasks:
> - napalm_install_config:
> hostname: "{{ inventory_hostname }}"
> username: "{{ username }}"
> password: "{{ password }}"
> dev_os: "{{ nxos }}"
> config_file: leaf.conf
> commit_changes: True
> diff_file: initial.diff
>
>
> This is the yml file. By default it tries to connect using HTTPS (NXAPI). How 
> do i bypass this and make it connect using SSH
>
> --
> 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/135ca6c8-7427-42ae-94e5-53ed2c77b425%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/CAKEs6adHRpPeRY-8R-ntS0__Dn89gMUXgOUKS6gP-5jagCNswA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Ansible Installation Issue on Linux

2018-03-21 Thread SHR
I  did installation using epel. So does that mean i have to reinstall using 
different epel rpm.


On Wednesday, March 21, 2018 at 3:49:22 PM UTC+5:30, Daley Okuwa wrote:
>
> hi,
>
> I think it requires a python module
> I mean the python module is missing
> I advise please reinstall again and check if the correct python module  is 
> installed
>
> On Wednesday, March 21, 2018 at 9:57:56 AM UTC, SHR wrote:
>
>> Hi All,
>>
>>   M getting below error message after ansible installation. Is this error 
>> can be ignorable:
>>
>> "
>> [root@Test0 Desktop]# ansible --version
>> ERROR! Unexpected Exception, this is probably a bug: (pyasn1 0.1.6 
>> (/usr/lib/python2.7/site-packages), Requirement.parse('pyasn1>=0.1.7'))
>> the full traceback was:
>>
>> Traceback (most recent call last):
>>   File "/usr/bin/ansible", line 85, in 
>> mycli = getattr(__import__("ansible.cli.%s" % sub, 
>> fromlist=[myclass]), myclass)
>>   File "/usr/lib/python2.7/site-packages/ansible/cli/__init__.py", line 
>> 38, in 
>> from ansible.inventory.manager import InventoryManager
>>   File "/usr/lib/python2.7/site-packages/ansible/inventory/manager.py", 
>> line 29, in 
>> from ansible.inventory.data import InventoryData
>>   File "/usr/lib/python2.7/site-packages/ansible/inventory/data.py", line 
>> 29, in 
>> from ansible.plugins.cache import FactCache
>>   File 
>> "/usr/lib/python2.7/site-packages/ansible/plugins/cache/__init__.py", line 
>> 30, in 
>> from ansible.plugins.loader import cache_loader
>>   File "/usr/lib/python2.7/site-packages/ansible/plugins/loader.py", line 
>> 22, in 
>> from ansible.parsing.plugin_docs import read_docstring
>>   File "/usr/lib/python2.7/site-packages/ansible/parsing/plugin_docs.py", 
>> line 12, in 
>> from ansible.parsing.yaml.loader import AnsibleLoader
>>   File "/usr/lib/python2.7/site-packages/ansible/parsing/yaml/loader.py", 
>> line 30, in 
>> from ansible.parsing.yaml.constructor import AnsibleConstructor
>>   File 
>> "/usr/lib/python2.7/site-packages/ansible/parsing/yaml/constructor.py", 
>> line 29, in 
>> from ansible.parsing.vault import VaultLib
>>   File 
>> "/usr/lib/python2.7/site-packages/ansible/parsing/vault/__init__.py", line 
>> 45, in 
>> from cryptography.hazmat.backends import default_backend
>>   File 
>> "/usr/lib64/python2.7/site-packages/cryptography/hazmat/backends/__init__.py",
>>  
>> line 7, in 
>> import pkg_resources
>>   File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 3011, in 
>> 
>> parse_requirements(__requires__), Environment()
>>   File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 630, in 
>> resolve
>> raise VersionConflict(dist,req) # XXX put more info here
>> VersionConflict: (pyasn1 0.1.6 (/usr/lib/python2.7/site-packages), 
>> Requirement.parse('pyasn1>=0.1.7'))
>>
>> "
>>
>

-- 
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/8947d742-1acb-4335-bb2b-b79535ddfdcf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: debug output for task

2018-03-21 Thread Cyberbob
team, 
any ideas?

вторник, 20 марта 2018 г., 20:25:49 UTC+3 пользователь Cyberbob написал:
>
> Hi team,
> i have this playbook:
>
> ---
> - hosts: "{{ leaf_name }}"
>   gather_facts: no
>   connection: local
>  
>   vars_prompt:
>
>   - name: "leaf_name"
> prompt: "Enter switch hostname/ip"
> private: no
>   - name: "vlan_id"
> prompt: "Enter access vlan  for L2 ACCESS setup (example 10)"
> private: no
>
>   vars:
> cli:
>   username: admin
>   password: password
>   transport: cli
>
>   tasks:
>
>   - name: Checking configuration for  vlan {{ vlan_id }}
> ignore_errors: true
> nxos_command:
>   commands: show vlan id {{ vlan_id }}
>   provider: "{{ cli }}"
> register: output
> 
>
>   - debug: var=output.stdout_lines
>   - debug:
>   msg="Looks like  switch {{ leaf_name }} has no vlan {{ vlan_id }}."
> when: output.stdout_lines is not defined
>
> The questions is: i want to get output if van exist and get message "Looks 
> like  switch {{ leaf_name }} has no vlan {{ vlan_id }}" if it doesn't. 
> What i must add to this 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/5a088753-db06-48a0-a406-a55de465ae49%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Failed to find handler for

2018-03-21 Thread danish09


When I am downloading a tar.gz file and unarchiving it using the unarchive 
module, ansible fails with "Failed to find handler for 
\"/usr/share/openjdk-9.0.4_linux-x64_bin.tar.gz\". Make sure the required 
command to extract the file is installed. Commands \"gtar\" and \"tar\" not 
found. Command \"unzip\" not found."


But when I run just the piece of code unarchive module code on an already 
present tar.gz file, ansible works perfectly. I already have all the 
missing packages installed in the box.


Thanks


ansible 2.4.3.0

the is the piece of code which fails:

- name: downloading java 
  get_url:
url: 
https://download.java.net/java/GA/jdk9/9.0.4/binaries/openjdk-9.0.4_linux-x64_bin.tar.gz
dest: /usr/share/
owner: root
group: root
mode: 0644  

- name: unarchiving java source file
  unarchive:
src: /usr/share/openjdk-9.0.4_linux-x64_bin.tar.gz
dest: /usr/share/
owner: root
group: root
mode: 0644

the piece of code which succeeds:

- name: unarchiving java source file
  unarchive:
src: /usr/share/openjdk-9.0.4_linux-x64_bin.tar.gz
dest: /usr/share/
owner: root
group: root
mode: 0644

-- 
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/ef00ba4a-c877-4543-aa7e-9c1329397aa4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Ansible Installation Issue on Linux

2018-03-21 Thread 'Daley Okuwa' via Ansible Project
hi,

I think it requires a python module
I mean the python module is missing
I advise please reinstall again and check if the correct python module  is 
installed

On Wednesday, March 21, 2018 at 9:57:56 AM UTC, SHR wrote:

> Hi All,
>
>   M getting below error message after ansible installation. Is this error 
> can be ignorable:
>
> "
> [root@Test0 Desktop]# ansible --version
> ERROR! Unexpected Exception, this is probably a bug: (pyasn1 0.1.6 
> (/usr/lib/python2.7/site-packages), Requirement.parse('pyasn1>=0.1.7'))
> the full traceback was:
>
> Traceback (most recent call last):
>   File "/usr/bin/ansible", line 85, in 
> mycli = getattr(__import__("ansible.cli.%s" % sub, 
> fromlist=[myclass]), myclass)
>   File "/usr/lib/python2.7/site-packages/ansible/cli/__init__.py", line 
> 38, in 
> from ansible.inventory.manager import InventoryManager
>   File "/usr/lib/python2.7/site-packages/ansible/inventory/manager.py", 
> line 29, in 
> from ansible.inventory.data import InventoryData
>   File "/usr/lib/python2.7/site-packages/ansible/inventory/data.py", line 
> 29, in 
> from ansible.plugins.cache import FactCache
>   File 
> "/usr/lib/python2.7/site-packages/ansible/plugins/cache/__init__.py", line 
> 30, in 
> from ansible.plugins.loader import cache_loader
>   File "/usr/lib/python2.7/site-packages/ansible/plugins/loader.py", line 
> 22, in 
> from ansible.parsing.plugin_docs import read_docstring
>   File "/usr/lib/python2.7/site-packages/ansible/parsing/plugin_docs.py", 
> line 12, in 
> from ansible.parsing.yaml.loader import AnsibleLoader
>   File "/usr/lib/python2.7/site-packages/ansible/parsing/yaml/loader.py", 
> line 30, in 
> from ansible.parsing.yaml.constructor import AnsibleConstructor
>   File 
> "/usr/lib/python2.7/site-packages/ansible/parsing/yaml/constructor.py", 
> line 29, in 
> from ansible.parsing.vault import VaultLib
>   File 
> "/usr/lib/python2.7/site-packages/ansible/parsing/vault/__init__.py", line 
> 45, in 
> from cryptography.hazmat.backends import default_backend
>   File 
> "/usr/lib64/python2.7/site-packages/cryptography/hazmat/backends/__init__.py",
>  
> line 7, in 
> import pkg_resources
>   File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 3011, in 
> 
> parse_requirements(__requires__), Environment()
>   File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 630, in 
> resolve
> raise VersionConflict(dist,req) # XXX put more info here
> VersionConflict: (pyasn1 0.1.6 (/usr/lib/python2.7/site-packages), 
> Requirement.parse('pyasn1>=0.1.7'))
>
> "
>

-- 
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/b56ade39-e3aa-4882-a902-b2f3102a92b0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Ansible Installation Issue on Linux

2018-03-21 Thread SHR
Hi All,

  M getting below error message after ansible installation. Is this error 
can be ignorable:

"
[root@Test0 Desktop]# ansible --version
ERROR! Unexpected Exception, this is probably a bug: (pyasn1 0.1.6 
(/usr/lib/python2.7/site-packages), Requirement.parse('pyasn1>=0.1.7'))
the full traceback was:

Traceback (most recent call last):
  File "/usr/bin/ansible", line 85, in 
mycli = getattr(__import__("ansible.cli.%s" % sub, fromlist=[myclass]), 
myclass)
  File "/usr/lib/python2.7/site-packages/ansible/cli/__init__.py", line 38, 
in 
from ansible.inventory.manager import InventoryManager
  File "/usr/lib/python2.7/site-packages/ansible/inventory/manager.py", 
line 29, in 
from ansible.inventory.data import InventoryData
  File "/usr/lib/python2.7/site-packages/ansible/inventory/data.py", line 
29, in 
from ansible.plugins.cache import FactCache
  File 
"/usr/lib/python2.7/site-packages/ansible/plugins/cache/__init__.py", line 
30, in 
from ansible.plugins.loader import cache_loader
  File "/usr/lib/python2.7/site-packages/ansible/plugins/loader.py", line 
22, in 
from ansible.parsing.plugin_docs import read_docstring
  File "/usr/lib/python2.7/site-packages/ansible/parsing/plugin_docs.py", 
line 12, in 
from ansible.parsing.yaml.loader import AnsibleLoader
  File "/usr/lib/python2.7/site-packages/ansible/parsing/yaml/loader.py", 
line 30, in 
from ansible.parsing.yaml.constructor import AnsibleConstructor
  File 
"/usr/lib/python2.7/site-packages/ansible/parsing/yaml/constructor.py", 
line 29, in 
from ansible.parsing.vault import VaultLib
  File 
"/usr/lib/python2.7/site-packages/ansible/parsing/vault/__init__.py", line 
45, in 
from cryptography.hazmat.backends import default_backend
  File 
"/usr/lib64/python2.7/site-packages/cryptography/hazmat/backends/__init__.py", 
line 7, in 
import pkg_resources
  File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 3011, in 

parse_requirements(__requires__), Environment()
  File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 630, in 
resolve
raise VersionConflict(dist,req) # XXX put more info here
VersionConflict: (pyasn1 0.1.6 (/usr/lib/python2.7/site-packages), 
Requirement.parse('pyasn1>=0.1.7'))

"

-- 
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/a185169d-2359-4e34-ab2e-010de5477e23%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Ansible issues with Windows deployment

2018-03-21 Thread 12177589
Hello, I think may be because of '-name' the problem, i deleted '-name', 
modified to the following code, can run.
But it gets stuck, probably because of other configuration issues like user 
passwords, and I'll look at the relevant documentation.thank you

- hosts: dbServer

  tasks:
  - win_shell: New-PSDrive -Name temp_path -PSProvider FileSystem -Root 
'\\192.168.20.13\WuhanTeam' -Credential New-Object -TypeName PSCredential 
-ArgumentList 'xie11', ConvertTo-SecureString -String '11' -AsPlainText 
-Force -Scope Script
  
  - win_shell: Copy-Item -Path temp_path:\100_test -DestinationPath C:\tools





在 2018年3月21日星期三 UTC+8上午11:12:59,Jordan Borean写道:
>
> You pretty much need to copy the win_shell task as it was (with any 
> credential or path changes you need). You also don't need the win_copy 
> tasks as the win_shell task will do that for you, I only provided that 
> example to show you how it is easier to use become when 2.5 comes out.
>
> In the future, when you say there are errors, please provide those errors 
> itself as it makes it easier to see what is going on.
>
> 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/0abe995d-e945-42ec-8396-5a0c6bf0ae17%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.