Re: [ansible-project] Encrypted Password in Playbook

2020-01-21 Thread Srinivas Naram
Any suggestions would be greatly appreciated. On Tue, Jan 21, 2020 at 8:05 PM Srinivas Naram wrote: > Hello Vladimir > > I have followed exactly same steps mentioned above and I see different > errors now. > > My steps > > - Set the Ansible Vault password file Env variable > - Create the vault

Re: [ansible-project] How to specify the user home directory dynamatically with /home/{{ 'echo{$USER}' }}/sub_dir for copying files with Ansible copy module ?

2020-01-21 Thread Michael Mullay
Frank, Something like this should work: > - name: Copy the sudoers file from ~/managed_files/sudo_ii/sudoers > to /etc on the remote VMs > copy: > src: "{{ lookup('env',HOME) > }}/managed_files/sudo_ii/sudoers > dest: /etc > owner: root >

[ansible-project] How to specify the user home directory dynamatically with /home/{{ 'echo{$USER}' }}/sub_dir for copying files with Ansible copy module ?

2020-01-21 Thread FRANK L
Hi, I would like to use git for managing Ansible playbooks for version control on an admin server in GCP. So the idea is this: each user in the admin group to run the playbooks pulled from the github ino their repo from each user's home. for exampel: for user1, run ansible playbooks

[ansible-project] Re: Flatpak not installing via playbook

2020-01-21 Thread Edward Crosby
So I was told by a source that I should use flatpak_remote for adding my repo. It worked. Here's the final playbook that works: *- hosts: localhost tasks:- name: Add flathub repo flatpak_remote:name: flathubstate: present flatpakrepo_url:

Re: [ansible-project] using when inside and outside a loop

2020-01-21 Thread Vladimir Botka
On Tue, 21 Jan 2020 12:17:17 -0800 (PST) Spiro Mitsialis wrote: > I want to do something like this below: > > - name: Create Simple list from Connection Dict > set_fact: > connections: "{{ connections | default([]) + [ { > 'switchid': item.id, > 'connectionid':

[ansible-project] using when inside and outside a loop

2020-01-21 Thread Spiro Mitsialis
I want to do something like this below: - name: Create Simple list from Connection Dict set_fact: connections: "{{ connections | default([]) + [ { 'switchid': item.id, 'connectionid': item.connections[0].id } ] }}" when: item.connections

Re: [ansible-project] ansible expect module not working with openshift installer prompt

2020-01-21 Thread Kai Stian Olstad
On 21.01.2020 12:03, vk wrote: Hi Kai, Here is the entire output: <127.0.0.1> EXEC /bin/sh -c 'rm -f -r /home/abcd/.ansible/tmp/ansible-tmp-1579604193.3820715-278276027061609/ > /dev/null 2>&1 && sleep 0' fatal: [localhost]: FAILED! => { "changed": true, "cmd":

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

2020-01-21 Thread Phil Griffiths
I’ve tried a few connections: It seems that ansible_user is not honoured with the network_cli plugin so make sure you’re not using that still: $ ansible cisco -m ios_command -a "commands='sh ip int br'" -e 'ansible_connection=network_cli' -e 'ansible_network_os=ios' -e 'ansible_user=ansible'

Re: [ansible-project] Can't contact LDAP server

2020-01-21 Thread Kai Stian Olstad
On 21.01.2020 04:01, Sandy Hung wrote: Dear All: I run command ldapsearch not contact LDAP server but try open port 636 can't open it please help me thanks. I can't see any Ansible related questions. This list is for Ansible and not for other random problems people must have. -- Kai

[ansible-project] [all:vars] ansible_become_method in host inventory file

2020-01-21 Thread Steven Peckins
I developed some playbooks using version 2.7 (I think). Last week I went to run them on what is now 2.9.2, and it seems to fail to pick up the become method from the inventory file like it used to, instead defaulting to "sudo". This is in my host inventory file: [all:vars]

Re: [ansible-project] Encrypted Password in Playbook

2020-01-21 Thread Srinivas Naram
Hello Vladimir I have followed exactly same steps mentioned above and I see different errors now. My steps - Set the Ansible Vault password file Env variable - Create the vault encrypted file - Create directories and copy files in specific location. My dir structure playbooks |-

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

2020-01-21 Thread Stu
https://docs.microsoft.com/en-us/windows-server/administration/openssh/openssh_install_firstuse Openssh server on windows is fairly new but I've been able to ssh with key to a windows server and run PowerShell commands. On Thursday, January 16, 2020 at 3:51:33 AM UTC, Jiwoong Lee wrote: > >

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

2020-01-21 Thread Yehuda Pinhas
Hi! To simplify stuff I am troubleshooting this problem with the command below: ansible -m ios_command -e commands='sh ip int br' -i /etc/ansible/inventory/ R-TEST-SNIF -e 'ansible_connection=network_cli' -e 'ansible_network_os=ios' -u ansible -k It will make it easier to troubleshoot this

Re: [ansible-project] Ansible and Jenkins Integration

2020-01-21 Thread Bariou Alarou
Then you will enable ansible plugin on your Jenkins system and connect theme through ssh-keys with one user create on both systems. Maybe the link below can help you. https://www.redhat.com/en/blog/integrating-ansible-jenkins-cicd-process Thanks On Tue, Jan 21, 2020 at 5:32 AM Sai Prasha

Re: [ansible-project] Encrypted Password in Playbook

2020-01-21 Thread Vladimir Botka
On Tue, 21 Jan 2020 15:31:33 +0530 Srinivas Naram wrote: > I am trying to maintain password (encrypted using ansible-vault) and my > playbook (clear-text) in separate files. Below is a step-by-step scenario: 1) Let's assume the vault password has bee configured properly (you have set the

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

2020-01-21 Thread Yehuda Pinhas
1. Yes. remote_user is already set on ansible.cfg file: # SSH timeout #timeout = 10 # default user to use for playbooks if user is not specified # (/usr/bin/ansible will use current user as default) remote_user = ansible # logging is off by default unless this path is defined # if so defined,

Re: [ansible-project] Ansible import playbooks with openstack error

2020-01-21 Thread Dick Visser
On Tue, 21 Jan 2020 at 10:07, sv wrote: > > Hi Experts, > > Im very new to ansible and trying to set a small project by executing the > scripts. > My anisble --version is 2.2.1.0 That is an ancient ansible version and has been EOL for ages. Since you're just starting to use ansible, please make

[ansible-project] Ansible and Jenkins Integration

2020-01-21 Thread Sai Prasha
Is it mandatory to have jenkins and Ansible to be installed on Same Server? I have Jenkins server installed on windows and ansible installed on Linux machine ,how to integrate Anisble and Jenkins? -- You received this message because you are subscribed to the Google Groups "Ansible Project"

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

2020-01-21 Thread Phil Griffiths
Have you tried setting remote_user? see https://docs.ansible.com/ansible/latest/plugins/connection/network_cli.html for details Also does the Cisco IOS device actually allow password authentication with SSH? You can check with something like: enable conf term ip ssh server authenticate user

Re: [ansible-project] Encrypted Password in Playbook

2020-01-21 Thread Stefan Hornburg (Racke)
On 1/21/20 11:01 AM, Srinivas Naram wrote: > Hello Vladimir, > > Thanks for your reply. > > I am trying to maintain password (encrypted using ansible-vault) and my > playbook (clear-text) in separate files. If I > understand correctly the below URL is suggesting to encrypt the password >

Re: [ansible-project] ansible error message

2020-01-21 Thread Vladimir Botka
On Tue, 21 Jan 2020 01:34:34 -0800 (PST) Sandy Hung wrote: > --- > - hosts: all > remote_user: sandy > become: true > > tasks: > >- name: install phpldapadmin > apt: name=phpldapadmin update_cache=yes > [...] > > vars: >certbot_generate_certificates: true >

Re: [ansible-project] Encrypted Password in Playbook

2020-01-21 Thread Srinivas Naram
Hello Vladimir, Thanks for your reply. I am trying to maintain password (encrypted using ansible-vault) and my playbook (clear-text) in separate files. If I understand correctly the below URL is suggesting to encrypt the password string and copy the same in my playbook.

Re: [ansible-project] ansible error message

2020-01-21 Thread Stefan Hornburg (Racke)
On 1/21/20 10:34 AM, Sandy Hung wrote: > --- > - hosts: all >   remote_user: sandy >   become: true > >   tasks: > >    - name: install phpldapadmin >      apt: name=phpldapadmin update_cache=yes > >    - name: install phpopenldap >      apt: >        name: '{{item.name}}' >        state:

Re: [ansible-project] ansible error message

2020-01-21 Thread Sandy Hung
--- - hosts: all remote_user: sandy become: true tasks: - name: install phpldapadmin apt: name=phpldapadmin update_cache=yes - name: install phpopenldap apt: name: '{{item.name}}' state: '{{item.state | default("present")}}' purge: yes with_items:

Re: [ansible-project] Ansible import playbooks with openstack error

2020-01-21 Thread Stefan Hornburg (Racke)
On 1/21/20 10:07 AM, sv wrote: > Hi Experts, > > Im very new to ansible and trying to set a small project by executing the > scripts. > My anisble --version is 2.2.1.0 > Python 2.7.12+ > and open stack version is v.3.0 > > I have a site.yaml file as below > site.yaml > - import_playbook:

Re: [ansible-project] ansible error message

2020-01-21 Thread Stefan Hornburg (Racke)
On 1/21/20 10:09 AM, Sandy Hung wrote: > Dear All: > > I don't know this error is? > can hlep me thanks. > > > ERROR! conflicting action statements: lineinfile, roles > > The error appears to be in '/home/sandy/phpldapadmin.yml': line 54, column 6, > but may > be elsewhere in the file

[ansible-project] ansible error message

2020-01-21 Thread Sandy Hung
Dear All: I don't know this error is? can hlep me thanks. ERROR! conflicting action statements: lineinfile, roles The error appears to be in '/home/sandy/phpldapadmin.yml': line 54, column 6, but may be elsewhere in the file depending on the exact syntax problem. The offending line appears

[ansible-project] Ansible import playbooks with openstack error

2020-01-21 Thread sv
Hi Experts, Im very new to ansible and trying to set a small project by executing the scripts. My anisble --version is 2.2.1.0 Python 2.7.12+ and open stack version is v.3.0 I have a site.yaml file as below site.yaml - import_playbook: repodb.yaml - import_playbook: dsm.yaml Im trying to

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

2020-01-21 Thread Yehuda Pinhas
Hi! I have found out that some IOS devices have problems with gather_facts and ansible does that by default. So I disabled it with gather_facts=no and now ansible continues to the next step now without gathering facts and skips the ios_facts error. Also I have changed some paramiko config on

Re: [ansible-project] Encrypted Password in Playbook

2020-01-21 Thread Vladimir Botka
On Mon, 20 Jan 2020 22:07:21 -0800 (PST) Srinivas Naram wrote: > In my inventory file I have created host vars > > [:vars] > ansible_user=root > ansible_password=!vault The encrypted value of the variable is missing. See "Use encrypt_string to create encrypted variables to embed in yaml".