Hy all,
I’m sorry i ask a lot of question but it’s my last question.
I have this file :
2,user2,hostname2,appli1
1,user1,hostname1,appli1,appli2,appli3, …
3,user3,hostname3,appli1
appli1 it’s one application for install on host hostname1 with user user1
Back appli1 there is other file appli1.pub with something word…
I have this task :
- name: Inser all appli in authorized_key
blockinfile:
block: “{{ lookup(‘file’, ‘{{ role_path }}/test_appli/{{ nom_appli }}.pub’) }}”
dest: ‘/home/{{ nv_user }}/.ssh/authorized_keys.test’
marker: “#CLE APPLICATIVE {{nom_appli}} DE {{ nv_user }}@{{ nv_host }}”
vars:
nom_appli: “{{ lookup(‘csvfile’, ‘{{ item }} file=clef_applicatives.csv delimiter=, col=3’) }}”
with_items: “{{ indice }}”
when: ansible_user and inventory_hostname in my_file
I want one task who see all name appli and who inser with blockinfile in other file.
Thank you
Regards,