Re: [ansible-project] How to pass information/variable while creating VM on esxxi server using Vmware_guest module

2020-01-16 Thread Rohan Kalap
Thank you, 
I went through your document it's really helpful, I will try those. Will 
let you know if i am able to use it.

On Friday, 10 January 2020 19:31:41 UTC+5:30, naveen s wrote:
>
> Hello Rohan, 
>
> it is always better to have the variables and its values in the group_vars 
> section and pass them while executing the playbook.
>
> 1. created a reusable playbook (create a variable inside the playbook in 
> which you want to pass it at the time of playbook execution).
> 2. create a group_vars directory and create the vars.yml for all the 
> variables values 
>
> please find the attachment for the code to launch a linux server in vmware.
>
> and also refer my github page for the vmware playbooks if need anything.
>
>
> https://github.com/naveensangadala/Devops-Ansible-Playbooks-for-VMware-AWS-Azure-Cloud
>   
>
> Thanks & Regards,
> Naveen Sangadala
> (+91 7676257193)
>
>
> On Fri, Jan 10, 2020 at 7:07 PM Rohan Kalap  > wrote:
>
>> Hello,
>>
>> I am looking to create VM from vmware_guest module on esxi server which 
>> is working fine with following playbook,
>> But- I want to pass details which are needed while booting into VM e.g 
>> hostname, username or license agreement.
>>
>> I tried using 
>> 1-custome values and 
>> 2-set_facts but this doesn't work under vmware_guest module
>>
>> is there any way to automate OS installation by providing variables?
>>
>> this is my playbook-
>> ---
>> - hosts: localhost
>>   gather_facts: no
>>   tasks:
>>   - debug:
>>   msg: connection to host machine successful
>>
>>   - name: create test1 vm from esxi server
>> #expect:
>> #command: "configuration file!"
>> #responses:
>> #'PRESS \ TO CONTINUE:': ''
>> vmware_guest:
>>   hostname: "x.x.x.x"
>>   username: "root"
>>   password: "password"
>>   validate_certs: no
>>   folder: /ha-datacenter/vm/
>>   name: "test-vm"
>>   state: poweredon
>>   guest_id: centos64Guest
>>   esxi_hostname: "hostname"
>>   disk:
>>   - size_gb: 160
>> type: thin
>> datastore: datastore1
>>   hardware:
>> memory_mb: 3000
>> num_cpus: 4
>> scsi: paravirtual
>>   cdrom:
>> type: iso
>> iso_path: "[datastore1] centos.iso"
>> #  expect:
>> #  command: "configuration!"
>> #  responses:
>> #'PRESS \ TO CONTINUE:': ''
>>   
>> customization: 
>> # i tried using customization attribute but of no use
>> hostname: "hostname"
>> domain: "network"
>>   networks:
>>   - name: VM Network
>> mac: aa:bb:dd:aa:00:23
>> ip: x.x.x.x
>> netmask: 255.255.255.0
>> device_type: vmxnet3
>>   wait_for_ip_address: yes
>> delegate_to: localhost
>> register: deploy_vm
>>
>> -- 
>> 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...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/ansible-project/3713e737-2147-4978-9fcb-28a22f371ee2%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/46975391-01a1-4c5e-b705-3fed5b429010%40googlegroups.com.


[ansible-project] Re: How can I connect to Windows Server using WinRM without password(like linux ssh authentication)?

2020-01-16 Thread Jiwoong Lee
Thanks for reply jessi,

I think your mentioned commands for openstack environment isn't it?

Could you please easily and further explain how can I connect to Ansible 
Server to Windows without password.

Thanks,

2020년 1월 16일 목요일 오후 3시 28분 25초 UTC+9, renu jessi 님의 말:
>
> WinRM HTTPS Listener
>
> The ConfigWinRMListenerPlugin configures a WinRM HTTPS listener with a 
> self signed certificate generated on the spot and enables (optionally) 
> basic authentication, which means that a secure communication channel can 
> be established between any client and the server being provisioned, without 
> the requirement of having both the client and the server in the same 
> domain.  A firewall rule is added by cloudbase-init in the Windows firewall 
> for TCP port 5986.
>
> A this point you can login into your server. To begin with, don’t forget 
> to add a rule to your security groups in OpenStack!
> 1
> nova secgroup-add-rule default tcp 5986 5986 0.0.0.0/0
>
> Get the admin password for the instance:
> 1
> nova get-password yourinstance ~/.ssh/your_ssh_rsa_key
>
> On your client connect to your instance as shown in the following 
> PowerShell snippet:
> 1
> 2
> 3
> 4
> 5
> 6
> $ComputerName = "yourserveraddress"
> # Provide your username and password (by default "Admin" and the password 
> you just obtained)
> $c = Get-Credential
> $opt = New-PSSessionOption -SkipCACheck -SkipCNCheck -SkipRevocationCheck
> $session = New-PSSession -ComputerName $ComputerName -UseSSL 
> -SessionOption $opt -Authentication Basic -Credential $c
> Enter-PSSession $session
>
> On Thursday, January 16, 2020 at 9:21:33 AM UTC+5:30, Jiwoong Lee wrote:
>>
>> Hi, all.
>>
>> Now I can connect to Linux server without password, It just using SSH key.
>>
>> And I need to connect Windows Server using WinRM but it need to Windows 
>> account and password.
>>
>> How can I connect to Windows Server without password?
>>
>> Please let me know any methods.
>>
>

-- 
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/58ddd790-4325-4b7e-90e5-eee5243fdd17%40googlegroups.com.


[ansible-project] List of triggered tasks

2020-01-16 Thread Guy Knights
Hi all,

Is there a globally-available list of triggered tasks? I'd love to be able
to send a notification of some kind at the end of a series of playbook
runs, which would include the list of changed tasks and any other
information that might be useful.

Thanks,
Guy

-- 

Guy Knights • Senior Systems Engineer
c: 778-996-2687p: 778-379-5120


  

-- 
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/CAFtmDk_nYoSpcPcs_OB%2BH0nSNRTkTh2ZCqePhRmD8Javxn0qag%40mail.gmail.com.


[ansible-project] Re: Windows mapped drives – what the hell is going on?

2020-01-16 Thread Jordan Borean
This is unfortunately outside of what I know and I can't really offer and 
more help. From what I can see the registry settings are the same when 
Ansible creates the drive vs when it's created with net use, even net use 
sees the drive, it's just not available. What you need to do now is enable 
file share auditing [1] on the target to try and track down why the drive 
is unavailable and what error is being reported by SMB that explains the 
failure a bit more.

[1] - 
https://docs.microsoft.com/en-us/windows/security/threat-protection/auditing/audit-file-share

-- 
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/1ca9fbf1-9902-4d06-9234-a0d31798da3e%40googlegroups.com.


[ansible-project] Re: loop and pass variables from vars_files to task command

2020-01-16 Thread Matthew DeSantos
Well I've tried rearranging my playbook to use a lookup plugin, which 
seems to work but I still can't figure out how to loop over my list until 
it completes.

I added this 'vars' section to the play with the same results as before (a 
single VLAN gets created and ansible moves onto the next task)

  vars:   
name: "{{lookup('vars', 'vlan_name')}}"
id: "{{lookup('vars', 'vlan_id')}}"
subnet: "{{lookup('vars', 'vlan_subnet')}}" 

-- 
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/20b0e3ad-376c-46ed-9118-20056beabddb%40googlegroups.com.


[ansible-project] Ansible firewalld module question

2020-01-16 Thread Xinhuan Zheng
Hello,


In Ansible firewalld module: 
https://docs.ansible.com/ansible/latest/modules/firewalld_module.html?highlight=firewalld,
 
in the examples like below:


- firewalld:
service: https
permanent: yes
state: enabled

We want to make it more descriptive in our role's tasks/main.yml file, since it 
is part of a large playbook:

- name: Firewalld open https
  firewalld:
service: https
permanent: yes
state: enabled

However, it doesn't work in the large playbook which calls that role. Does 
anybody know why?

Thank you,

- Xinhuan

-- 
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/df271954-87ac-4f01-b969-a1e0fd152dfe%40googlegroups.com.


Re: [ansible-project] Re: Does current Ansible support templates macro?

2020-01-16 Thread Xinhuan Zheng
Hello Mr. Botka,

This is exactly what I am looking for. It looks so neat with ini_file 
module instead of template. I'll play with it in my tasks.

Thank you very much! :)

- Xinhuan

On Thursday, January 16, 2020 at 10:50:25 AM UTC-5, Vladimir Botka wrote:
>
> On Thu, 16 Jan 2020 05:49:07 -0800 (PST) 
> Xinhuan Zheng > wrote: 
>
> > sssd_config: 
> >   sssd: 
> > debug_level: 1 
> > additional_key: additional_value 
> > another_addtional_key: another_additional_value 
> >   nss: 
> > reconnection_retries: 3 
> > additional_key: additional_value 
> > another_addtional_key: another_additional_value 
> >   pam: 
> > debug_level: 5 
> > additional_key: additional_value 
> > another_addtional_key: another_additional_value 
> > 
> > Because this is so difficult to manipulate in template (I spend most 
> > yesterday to figure it out), I think it is probably better just put 
> > INI-style content into template file 
>
> It also possible to use module 'ini_file' 
> https://docs.ansible.com/ansible/latest/modules/ini_file_module.html 
>
> With the configuration data transformed to this list 
>
>   sssd_config: 
> - params: 
> - additional_key: additional_value 
> - reconnection_retries: 3 
> - another_addtional_key: another_additional_value 
>   section: nss 
> - params: 
> - debug_level: 5 
> - another_addtional_key: another_additional_value 
> - additional_key: additional_value 
>   section: pam 
> - params: 
> - debug_level: 1 
> - another_addtional_key: another_additional_value 
> - additional_key: additional_value 
>   section: sssd 
>
> the task below 
>
> - ini_file: 
> path: /scratch/tmp/config.ini 
> section: "{{ item.0.section }}" 
> option: "{{ item.1.keys()|list|first }}" 
> value: "{{ item.1.values()|list|first }}" 
>   with_subelements: 
> - "{{ sssd_config }}" 
> - params 
>
> gives 
>
> $ cat /scratch/tmp/config.ini 
> [nss] 
> additional_key = additional_value 
> reconnection_retries = 3 
> another_addtional_key = another_additional_value 
> [pam] 
> debug_level = 5 
> another_addtional_key = another_additional_value 
> additional_key = additional_value 
> [sssd] 
> debug_level = 1 
> another_addtional_key = another_additional_value 
> additional_key = additional_value 
>
> -- 
>

-- 
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/eeb236a9-a093-4f7c-b981-943f43989367%40googlegroups.com.


[ansible-project] prompt with loop

2020-01-16 Thread Karther
I would like that with each creation of vm of my csv file, it asks me for a 
confirmation o / n which I put in my prompt?

Example:

Would you like to create this vm "vmname" (o / n)? :

I would like him to ask me this question each time I create my vm, so each 
loop

My tasks is :

vars_prompt:
- name: "choix_utilisateur"
  prompt: "Do you want to create the VM ? (o/n) :"
  private: no
  default: "n"

  tasks:

  - name: read the csv file
read_csv:
  path: /root/Projet_Ansible/roles/files/create_vm.csv
  delimiter: ','
register: report_csv
delegate_to: localhost


- name: "Create a virtual machine ESXI"
vmware_guest:
  hostname: "172.180.0.133"
  username: "root"
  password: "espoire"
  port: 443
  validate_certs: no
  folder: ""
  name: "{{ vm.vmname }}"
  datacenter: "{{ vm.datacenter }}"
  state: poweredoff
  guest_id: centos64Guest
  # This is hostname of particular ESXi server on which user wants VM 
to be deployed
  esxi_hostname: "172.180.0.100"
  disk:
  - size_gb: "{{ vm.sizegb }}"
type: thin
datastore: "{{ vm.datastore }}"
  hardware:
memory_mb: "{{ vm.memory }}"
num_cpus: "{{ vm.numcpu }}"
scsi: paravirtual
  networks:
  - name: VM Network
device_type: vmxnet3
register: deploy_vm
delegate_to: localhost
loop: "{{ report_csv.list }}"
loop_control:
  loop_var: vm
when: choix_utilisateur == "o" and inventory_hostname in groups['ESXI']


Someone have any idea please ??

Thanks you very much community ansible !!! :)

Best regards,

Karther

-- 
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/72f1064e-1984-4297-bcba-d2f118d9d424%40googlegroups.com.


Re: [ansible-project] Re: Does current Ansible support templates macro?

2020-01-16 Thread Vladimir Botka
On Thu, 16 Jan 2020 05:49:07 -0800 (PST)
Xinhuan Zheng  wrote:

> sssd_config: 
>   sssd: 
> debug_level: 1 
> additional_key: additional_value
> another_addtional_key: another_additional_value
>   nss: 
> reconnection_retries: 3 
> additional_key: additional_value
> another_addtional_key: another_additional_value
>   pam: 
> debug_level: 5 
> additional_key: additional_value
> another_addtional_key: another_additional_value
> 
> Because this is so difficult to manipulate in template (I spend most 
> yesterday to figure it out), I think it is probably better just put 
> INI-style content into template file

It also possible to use module 'ini_file'
https://docs.ansible.com/ansible/latest/modules/ini_file_module.html

With the configuration data transformed to this list

  sssd_config:
- params:
- additional_key: additional_value
- reconnection_retries: 3
- another_addtional_key: another_additional_value
  section: nss
- params:
- debug_level: 5
- another_addtional_key: another_additional_value
- additional_key: additional_value
  section: pam
- params:
- debug_level: 1
- another_addtional_key: another_additional_value
- additional_key: additional_value
  section: sssd

the task below

- ini_file:
path: /scratch/tmp/config.ini
section: "{{ item.0.section }}"
option: "{{ item.1.keys()|list|first }}"
value: "{{ item.1.values()|list|first }}"
  with_subelements:
- "{{ sssd_config }}"
- params

gives

$ cat /scratch/tmp/config.ini 
[nss]
additional_key = additional_value
reconnection_retries = 3
another_addtional_key = another_additional_value
[pam]
debug_level = 5
another_addtional_key = another_additional_value
additional_key = additional_value
[sssd]
debug_level = 1
another_addtional_key = another_additional_value
additional_key = additional_value

--

-- 
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/20200116164920.529c3f99%40gmail.com.


pgpIa1tyFhD1N.pgp
Description: OpenPGP digital signature


[ansible-project] How create vlans if he don't exist in the file gathred by ios_facts

2020-01-16 Thread Kaouane Alaaeddine
Hello,

I want to create (configurate) "vlan" in my device (switch) when it is not 
available on my equipment 
  

for configurate or ( add) vlan in the switch I use the module  "ios_vlans"

for gather facts of my device I use "ios_facts"

you will find below how are stored all the vlans currently available on my 
equipment 

"ansible_network_resources": {
"vlans": [
{
"mtu": 1500,
"name": "default",
"shutdown": "disabled",
"state": "active",
"vlan_id": 1
},
{
"mtu": 1500,
"name": "V2-SPA-LAN-A-Admin",
"shutdown": "disabled",
"state": "active",
"vlan_id": 2
},
{
"mtu": 1500,
"name": "VLAN0010",
"shutdown": "disabled",
"state": "active",
"vlan_id": 10
},
{
"mtu": 1500,
"name": "Total",
"shutdown": "disabled",
"state": "active",
"vlan_id": 20
},
{
"mtu": 1500,
"name": "youpi",
"shutdown": "disabled",
"state": "active",
"vlan_id": 222
}

I'm trying to find of way of how doing it thanks to when conditionnal in 
ansible but can't find it.
Thanks for you help 

-- 
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/1956c19d-eef2-4274-b696-1c4d246590cd%40googlegroups.com.


Re: [ansible-project] Re: Does current Ansible support templates macro?

2020-01-16 Thread Xinhuan Zheng
Hello,

Your testing looks fine in the test data model. However, the sssd_config 
real data model is like below:

sssd_config: 
  sssd: 
debug_level: 1 
additional_key: additional_value
another_addtional_key: another_additional_value
  nss: 
reconnection_retries: 3 
additional_key: additional_value
another_addtional_key: another_additional_value
  pam: 
debug_level: 5 
additional_key: additional_value
another_addtional_key: another_additional_value

The addtional_key and another_additional_key isn't same per section 
(pam,nss,sssd), and number of additional_key per section isn't identical 
either. So nss section may have 5 key/value pairs, pam may have 6 key/value 
pairs, and sssd may have only 3 key/value pairs. Each additional_key is 
pretty much unique to that section.

Because this is so difficult to manipulate in template (I spend most 
yesterday to figure it out), I think it is probably better just put 
INI-style content into template file, then fill in the values from 
variables that varies for that key/value pair. It makes the work more 
simpler.

Thank you for providing the test case. I'll remember this lesson.

- Xinhuan


On Wednesday, January 15, 2020 at 3:45:44 PM UTC-5, Vladimir Botka wrote:
>
> On Wed, 15 Jan 2020 11:57:49 -0800 (PST) 
> Xinhuan Zheng > wrote: 
>
> > I tested the solution, it doesn't work. item.1 becomes: 
> > {u'id_provider': u'local', u'auth_provider': u'local', u'enumerate': 
> True} 
> > So I get error there is no keys on {{ item.1.keys().0 }} 
>
> Both versions works for me. Double-check the code. The playbook 
>
> - hosts: localhost 
>   vars: 
> sssd_config: 
>   sssd: 
> debug_level: 1 
>   nss: 
> reconnection_retries: 3 
>   pam: 
> debug_level: 5 
>   tasks: 
> - template: 
> src: template.j2 
> dest: config.ini 
>
> with the template 
>
> % for item in sssd_config.items() %} 
> [{{ item.0 }}] 
> {{ item.1.keys().0 }}={{ item.1.values().0 }} 
> {% endfor %} 
> # -- 
> {% for item in sssd_config.items() %} 
> [{{ item.0 }}] 
> {% for iitem in item.1.items() %} 
> {{ iitem.0 }}={{ iitem.1 }} 
> {% endfor %} 
> {% endfor %} 
>
> gives 
>
> [nss] 
> reconnection_retries=3 
> [pam] 
> debug_level=5 
> [sssd] 
> debug_level=1 
> # -- 
> [nss] 
> reconnection_retries=3 
> [pam] 
> debug_level=5 
> [sssd] 
> debug_level=1 
>
> -- 
>

-- 
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/2b863977-2dc5-425f-86f9-e4d7130fad70%40googlegroups.com.


Re: [ansible-project] Ansible passwordless login not working

2020-01-16 Thread Vladimir Botka
On Thu, 16 Jan 2020 01:36:28 -0800 (PST)
Yehuda Pinhas  wrote:

> How is it SSH problem if I can add a public key or just regulary SSH and 
> its working?

SSH tried (publickey,keyboard-interactive,password) and failed

> fatal: [R-TEST-SNIF]: UNREACHABLE! => {"changed": false, "msg": "Failed to 
> connect to the host via ssh: Warning: Permanently added 
> 'r-test-snif,10.70.54.102' (RSA) to the list of known hosts.\r\nPermission 
> denied (publickey,keyboard-interactive,password).", "unreachable": true}

I can only repeat: Find out why 'password' permission was denied.

See "Network Debug and Troubleshooting Guide"
https://docs.ansible.com/ansible/latest/network/user_guide/network_debug_troubleshooting.html#network-debug-and-troubleshooting-guide

and "Enabling Networking device interaction logging" in particular
https://docs.ansible.com/ansible/latest/network/user_guide/network_debug_troubleshooting.html#enabling-networking-device-interaction-logging
Quoting:  "Ansible 2.8 features added logging of device interaction in log
file to help diagnose and troubleshoot issues regarding Ansible Networking
modules."

If you want to proceed in a systemic way get the log.

-vlado

-- 
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/20200116121050.0ee1d74e%40gmail.com.


pgpaKGSZ4tp5y.pgp
Description: OpenPGP digital signature


[ansible-project] Skip caching facts for specific hosts

2020-01-16 Thread Anjana Raghavendra P
I run ansible playbooks on multiple servers as controller servers and now 
want to start using the cache plugin. As each controller server is 
"localhost" for playbook, the facts captured by one controller server are 
getting replaced by another server making the cache data not usable. So, 
checking to see if I can skip caching of facts when the hostname is 
localhost. Is it possible in current 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/5a038e49-f5c1-4331-a684-357d226ec4df%40googlegroups.com.


Re: [ansible-project] Ansible passwordless login not working

2020-01-16 Thread Yehuda Pinhas
Hi Douglas,
This is the result of --ask-pass:

[image: Capture.PNG]


I have no idea what that means haha. What do you think?

-- 
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/1b6b38ae-78ab-498f-b087-38df4eef2a17%40googlegroups.com.


Re: [ansible-project] Ansible passwordless login not working

2020-01-16 Thread Douglas Evert
When adding a public key are you adding it to an amiable user or to another 
user and does your ping work if you pass —ask-pass?

Sent from my iPhone

> On Jan 16, 2020, at 04:36, Yehuda Pinhas  wrote:
> 
> 
> I'm not sure that  "connection: network_cli" because not matter what i do I 
> get the same error... Its just not working.
> 
> 
> How is it SSH problem if I can add a public key or just regulary SSH and its 
> working? that proves that its not an SSH problem on my remote machine and 
> leaves the fault in the ansible code side..
> 
> Any other ideas?
> -- 
> 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/b9eb97d9-87d6-48fe-8077-4f0b3c78f3dd%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/2CCAF59F-3E77-4BEE-A54F-F9F6EE7C4E9A%40gmail.com.


Re: [ansible-project] Ansible passwordless login not working

2020-01-16 Thread Yehuda Pinhas
*I have no idea what to do next.. also ping check fails..*

[image: Capture.PNG]

*Again, if im adding the publickey for passwordless authentication Ansible 
works.. but without it its not..*

*This is the configuration on the router side:*

R-TEST-SNIF#sh run
Building configuration...

Current configuration : 1474 bytes
!
! Last configuration change at 07:42:41 EST Wed Jan 15 2020
!
version 15.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R-TEST-SNIF
!
boot-start-marker
boot-end-marker
!
aqm-register-fnf
!
!
no aaa new-model
clock timezone EST -5 0
mmi polling-interval 60
no mmi auto-configure
no mmi pvc
mmi snmp-timeout 180
!
!
!
!
!
!


!
!
!
!
ip domain name EVE
ip cef
no ipv6 cef
!
multilink bundle-name authenticated
!
!
!
!
!
!
!
!
username ansible privilege 15 password 0 ansible
!
redundancy
!
!
ip ssh version 2
! 
!
!
!
!
! 
!
!
!
!
!

!
ip forward-protocol nd
!
!
no ip http server
no ip http secure-server
!
!
!
!
control-plane
!
!
!
!
!
!
!
!
line con 0
 exec-timeout 0 0
 logging synchronous
line aux 0
line vty 0 4
 exec-timeout 0 0
 logging synchronous
 login local
 transport input telnet ssh
 transport output telnet ssh
!
!
end


*crypto key rsa generate proof:*

R-TEST-SNIF#  show crypto key mypubkey rsa
% Key pair was generated at: 05:35:04 EST Jan 15 2020
Key name: R-TEST-SNIF.EVE
Key type: RSA KEYS
 Storage Device: private-config
 Usage: General Purpose Key
 Key is not exportable.
 Key Data:
  307C300D 06092A86 4886F70D 01010105 00036B00 30680261 00A5F2FB C8D19FA7 
  E19B9A1E 92976C47 174482FA 788CEA72 85AEF6E9 F0336651 CFE2DA99 316C94A2 
  45A9C27F A2E37D40 C2EE2A39 81B2C4C9 E3BB751C 20CD8C2A 1A632617 AE46F329 
  05CC6D09 483607CB 20DBC972 C2A92124 63FD1EFB E9A66E8C 07020301 0001
% Key pair was generated at: 05:35:04 EST Jan 15 2020
Key name: R-TEST-SNIF.EVE.server
Key type: RSA KEYS
Temporary key
 Usage: Encryption Key
 Key is not exportable.
 Key Data:
  306C300D 06092A86 4886F70D 01010105 00035B00 30580251 00AC4D25 1A615FB6 
  1FFEFF70 1A0C72A8 C9C26E3A C4F9AA7D 8C47CE5B 0FCC59A7 CADA0BC8 C173D620 
  26E5445E 65BBAAF2 915B844C 71B0D855 ADB5BBBC 68314F14 3F891C0D 8162B869 
  C227A0B0 C4592A93 5F020301 0001


*Its probably some command missing on the router side.. *
*anyone have any idea what is missing?*

-- 
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/8a9ba6ec-a380-4c6f-94e3-0d40f93c8aa6%40googlegroups.com.


Re: [ansible-project] Ansible passwordless login not working

2020-01-16 Thread Yehuda Pinhas
I'm not sure that  "connection: network_cli" because not matter what i do I 
get the same error... Its just not working.


How is it SSH problem if I can add a public key or just regulary SSH and 
its working? that proves that its not an SSH problem on my remote machine 
and leaves the fault in the ansible code side..

Any other ideas?

-- 
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/b9eb97d9-87d6-48fe-8077-4f0b3c78f3dd%40googlegroups.com.


Re: [ansible-project] register results in a text file after retrieving it on a device with (gather_facts)

2020-01-16 Thread Kaouane Alaaeddine
Hello Brian,
thanks you for your answer,
I've already tried to used the template fonction but i can solves this
issus " i don't know exactly what i must to do
I am a very beginner in this field, i don't understand all of ansible,
i want some help can, and orient me or help to bluid this script

regards


Le mer. 15 janv. 2020 à 18:48, Brian Coca  a écrit :

> instead of the 2 debug statements use a `template` action
> https://docs.ansible.com/ansible/latest/modules/template_module.html if
> you delegate_to: localhost it will write the file on the controller.
>
> --
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/CACVha7dzV9ZWkCXtFUpki8v-WnS2y%3D-YdnQO68QOyiTvp%2BfatA%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/CALterY2V37D5GudXb8uYzgi6BmEnt8GLbFs%2BOEdZtfM0exXu4w%40mail.gmail.com.


[ansible-project] Re: Windows mapped drives – what the hell is going on?

2020-01-16 Thread Pjotr Banas
Hi Jordan,

1) When you map it manually with net use, can you log off and back on and 
the drive still remains connected and visible in Windows Explorer?
- Yes
2) The output for 'net use' on a limited process is showing that the Z map 
is configured but is unavailable, does the drive show up in Windows 
Explorer, maybe with a red X?
- No, there is no Z: drive
3) If yes to the above, what happens when you try and open it up or just 
navigate to Z?
- N/A
4) Can you use Ansible to map a shared path on any other server?
- The same situation on other VMs in the same domain :(
5) In your limited/admin processes you ran the tests on, are they the same 
account or is your admin account a completely separate account?
- I'm not sure if I understood your question correctly, wro4gtp is not an 
admin account, i ran only powershell app in 'as administrator' mode (all 
the time I use elvis account)



On Thursday, January 16, 2020 at 12:51:50 AM UTC+1, Jordan Borean wrote:
>
> Unfortunately I cannot explain this at all, a couple of final 
> question/clarifications
>
>- When you map it manually with net use, can you log off and back on 
>and the drive still remains connected and visible in Windows Explorer?
>- The output for 'net use' on a limited process is showing that the Z 
>map is configured but is unavailable, does the drive show up in Windows 
>Explorer, maybe with a red X
>- If yes to the above, what happens when you try and open it up or 
>just navigate to Z
>- Can you use Ansible to map a shared path on any other server
>- In your limited/admin processes you ran the tests on, are they the 
>same account or is your admin account a completely separate account
>
> The only extra thing you can do is enable file share audit logs on the UNC 
> target and attempt to audit why the connections are failing. I don't know 
> of any way to audit the LANMan Redirector locally to see why it failed to 
> map the drive when you log in after Ansible is run.
>
> 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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/88e7a8bf-d8cc-44dc-ae63-0d55ce5c5039%40googlegroups.com.