Re: [ansible-project] I need to save fact into variable and use it afterwards

2022-08-01 Thread boncalo mihai
onal Institute of Standards and Technology > US Dept of Commerce > On Thursday, July 28, 2022 at 12:58:11 PM UTC-4 dnmv...@gmail.com wrote: > >> Just copy paste with the computer clipboar

Re: [ansible-project] I need to save fact into variable and use it afterwards

2022-07-28 Thread boncalo mihai
u can't stack moustaches > > On Thu, 28 Jul 2022 at 17:43, boncalo mihai wrote: > >> I have a task with run_once:true , which must run only on the first host >> and I need to use that hostname into a lookup file , something like this: >> >> - >> >> >>

Re: [ansible-project] I need to save fact into variable and use it afterwards

2022-07-28 Thread boncalo mihai
~ '/root/.ssh/id_rsa.pub') }}"} On Thu, Jul 28, 2022 at 7:39 PM Dick Visser wrote: > You can't stack moustaches > > On Thu, 28 Jul 2022 at 17:43, boncalo mihai wrote: > >> I have a task with run_once:true , which must run only on the first host >> and I need to use

[ansible-project] I need to save fact into variable and use it afterwards

2022-07-28 Thread boncalo mihai
I have a task with run_once:true , which must run only on the first host and I need to use that hostname into a lookup file , something like this: - * name: Print facts debug:var: ansible_nodename register: admin_host* *- name: Set authorized key took from file become: yes

[ansible-project] Ansible skipping other hosts

2022-07-20 Thread boncalo mihai
Hi, I have some tasks in a role that creates .ssh directory, generates a key on one of the servers, copy the public key on local and then run authorized_key module to copy the public key in the other nodes. The problem is that after generating the key with the condition that gets executed only on

Re: [ansible-project] how do i lookup id_rsa.pub on a host and copy it to authorized keys on multiple servers

2022-07-20 Thread boncalo mihai
Just did that, you use authorized_key module On Wed, Jul 20, 2022 at 4:24 PM Tony Wong wrote: > how do I lookup id_rsa.pub on a host and then run ansible playbook to copy > it to their authorized_key file? > > > -- > You received this message because you are subscribed to the Google Groups >

Re: [ansible-project] Re: Vault encrypting password over the network or just locally

2019-02-28 Thread boncalo mihai
Obvious...my bad, stupid uquestion On Thu, Feb 28, 2019 at 12:45 AM Kai Stian Olstad wrote: > > On 27.02.2019 23:35, boncalo mihai wrote: > > Does anyone know? > > > > On Mon, Feb 25, 2019, 3:34 PM boncalo mihai wrote: > > > >> Hi, > >> >

[ansible-project] Re: Vault encrypting password over the network or just locally

2019-02-27 Thread boncalo mihai
Does anyone know? On Mon, Feb 25, 2019, 3:34 PM boncalo mihai wrote: > Hi, > > I'm trying to secure my ansible playbook and one of the steps is > securing the password. I know that I can store the password encrypted > inside ansible vault and than use directly from the vault and

[ansible-project] Vault encrypting password over the network or just locally

2019-02-25 Thread boncalo mihai
Hi, I'm trying to secure my ansible playbook and one of the steps is securing the password. I know that I can store the password encrypted inside ansible vault and than use directly from the vault and send it over the network (e.g. change pass) but the question is, the password is decrypted and

Re: [ansible-project] Re: Change password using script

2019-01-29 Thread boncalo mihai
Thanks Kai, I searched for more information on rc but the documentation is poor. Thank you for the information! On Tue, Jan 29, 2019 at 8:44 PM Kai Stian Olstad wrote: > > On 29.01.2019 19:33, boncalo mihai wrote: > > Still could use if i found out what's wrong with using rc since th

[ansible-project] Re: Change password using script

2019-01-29 Thread boncalo mihai
Still could use if i found out what's wrong with using rc since the syntax is the same as on ansible website On Tue, Jan 29, 2019 at 8:32 PM boncalo mihai wrote: > > Issue solved, used "is succeeded" for validation instead of rc == 1 > > On Tue, Jan 29, 2019 at 6:26 P

[ansible-project] Re: Change password using script

2019-01-29 Thread boncalo mihai
Issue solved, used "is succeeded" for validation instead of rc == 1 On Tue, Jan 29, 2019 at 6:26 PM boncalo mihai wrote: > > Hi guys, > > I kinda feel ashamed asking this kind of questions but I'm currently > still learning Ansible, only started a week ago and I have to

Re: [ansible-project] Running yum updates with ansible

2019-01-29 Thread boncalo mihai
I know this is an ansible group but you could attach dmesg output if you get one after the kernel fails to boot. Check/var/log/boot-(date) /var/log/dmesg /var/log/yum.log ...you can start from there. Also I don't know if you're logging ansible actions every time, but you could find answers

[ansible-project] Change password using script

2019-01-29 Thread boncalo mihai
Hi guys, I kinda feel ashamed asking this kind of questions but I'm currently still learning Ansible, only started a week ago and I have to complete this as a part of a personal project that I will present. I wrote a simple playbook for changing passwords on linux systems, will have to add

Re: [ansible-project] Password change automation

2019-01-25 Thread boncalo mihai
in order to be associated to a IP Address if I'm not mistaken. Thanks, Mihai. On Sat, Jan 26, 2019 at 12:29 AM Kai Stian Olstad wrote: > > On 25.01.2019 22:51, boncalo mihai wrote: > > I don't know Ansible too much but the error "skipping: no hosts > > matched" doesn't

Re: [ansible-project] Password change automation

2019-01-25 Thread boncalo mihai
But I'm using a hashing filter inside the platbook for that - password_hash('sha512') >From your link - "Use the integrated Hashing filters to generate a hashed version of a password. You shouldn’t put plaintext passwords in your playbook or host_vars; instead, use Using Vault in playbooks to

Re: [ansible-project] Create variables in hash

2019-01-25 Thread boncalo mihai
key: {{ my_key | hash('sha1') }} ... Hashing filters New in version 1.9. To get the sha1 hash of a string: {{ 'test1' | hash('sha1') }} To get the md5 hash of a string: {{ 'test1' | hash('md5') }} Get a string checksum: {{ 'test2' | checksum }} Other hashes (platform dependent): {{

[ansible-project] Password change automation

2019-01-25 Thread boncalo mihai
Hi, I know there are lots of examples on the internet but I can't make it work ansible-playbook --private-key=/root/docker/aatool/ky.pem --extra-vars admin_password=T3est@ chpass.yml [WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not

Re: [ansible-project] Beginner, can't complete this step

2019-01-14 Thread boncalo mihai
Work like a charm! Thank you! On Tue, Jan 15, 2019 at 12:51 AM James Cassell wrote: > > > > On Mon, Jan 14, 2019, at 5:44 PM, boncalo mihai wrote: > > Hi > > Sorry , this must be to easy for you but I can't figure it out. I was > > following some ansible video tu

[ansible-project] Beginner, can't complete this step

2019-01-14 Thread boncalo mihai
Hi Sorry , this must be to easy for you but I can't figure it out. I was following some ansible video tutorials and I can't go further because of some errors ansible all -m user -a name=linda ansible3 | FAILED! => { "changed": false, "msg": "useradd: Permission denied.\nuseradd: cannot