From e66daa065f0e70b669aedf36d179d8df2740a350 Mon Sep 17 00:00:00 2001 From: davidl Date: Wed, 26 Jul 2023 09:45:38 +0200 Subject: [PATCH] sa --- .../{add_public_key => }/add_public_key.yml | 8 +++----- create_user_ssh/add_public_key/variables.yml | 11 +++++++++++ 2 files changed, 14 insertions(+), 5 deletions(-) rename create_user_ssh/{add_public_key => }/add_public_key.yml (52%) create mode 100644 create_user_ssh/add_public_key/variables.yml diff --git a/create_user_ssh/add_public_key/add_public_key.yml b/create_user_ssh/add_public_key.yml similarity index 52% rename from create_user_ssh/add_public_key/add_public_key.yml rename to create_user_ssh/add_public_key.yml index 9b52c2e..609e671 100644 --- a/create_user_ssh/add_public_key/add_public_key.yml +++ b/create_user_ssh/add_public_key.yml @@ -1,14 +1,12 @@ --- - hosts: "{{ host }}" vars: - vars_files: - - variables.yml tasks: - name: Add ssh pub keys authorized_key: - user: "{{ item.name }}" - key: "{{ item.key }}" + user: "{{ user }}" + key: "{{ key }}" state: present manage_dir: yes - with_items: "{{ users }}" + diff --git a/create_user_ssh/add_public_key/variables.yml b/create_user_ssh/add_public_key/variables.yml new file mode 100644 index 0000000..69000e6 --- /dev/null +++ b/create_user_ssh/add_public_key/variables.yml @@ -0,0 +1,11 @@ +host: all +##host: "giditek.*,atento.*,bergecloud.*sonda*.argos.*" + +users: +# - name: pedro.delbarco +# key: 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCoVRI3thSvUO4exvEIGu0Kg57Rmt6EOyRiadJU86Oelcr5rCO9HyP1fKAdBS1of9TdhcdXztxB/6xKGg6vqEQ6X0VOFBJalpZ5puB8bzSVywdfQvZVxCPzMTlKQ6jFsN/74f2hL8DHVUnMfNIZFRXsOreJjbEqnE/CvUw9SKPmWD2VmTaxZy6Fiz9EaQ3yc5onBHgc2sCuoFuFFtwmANiVEejO3FGvm3xSnUN+LDTPMYvjTVgOgOiE+CXGjU5QMUIdJmSqRqACluuZyRKmDDvsdltXLH2vhMs6e4A2Xim0ZzkSkiTpJqh2r0cHcDQ6cQYqX+2ENiWeugM+ueed0xeV pedro.delbarco@thor' + - name: ruben.valles + key: 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDHFG9s2iWDwiBTHmczwtXnH276FfAY5ehCmMkB6KMIrKl38DHxEWY3ajHUdnXsN7kL9EGmh4cKMaW3MYtDTFVAFs3dzupyJuOMbSV3KWXn5dcOfmV4m6IxjV8fyVQSF7xEmD/vXFxJOzY7wJnYMnAGD1RCqVx7r6XefCqHoXLm2LQ/IcIjFiBa3QeSW8KZ5wdHdoGtFYJFrPipr7RZ/ByU144AWyaxEloEdYwzOmzY2BOLsmst+Q8GBa8CCDiTnehLp/4Jxpvz5pByaIpqCh1od4Wpi+01id0FlKOPPvzu6GvkkQ5Vp3Eq2KvnDQENN6/rgnbvozs0JpjsLNKfb2x5Bkgjts3GYhdNWxEPpxCThtCzsRGUYb+XcRzG2ufmdYdq+nT+tPxOpI9MX2MnR+M/Z2u2aL8zWfEei73xg09UO5xgHPhW/hzyVHlLljO6qgAfZui/12FEUzbIBESNsoIc6mspvQcQhUdreaeFa8qlxqZ9rr5CmX+lRrnszbcHo9s0BmNUnt8BS79krHfJ0s/k8aCN0t+JPJF2yJNgxDGW9URS8kMfgHFbETsj0kZ87EueU6Opom9cy9QKxGa/hmm+WzO50EaQR6MEk2doc6J9tcVOnF0qAifCc+++89XBS7BmEiTa+WoV2/Znw/4ScmsxVjo6MKHB8cNR6q6CMMyLJw== rvalles@ubuntu1604' +# Public key for backups with elmo +# - name: elmo +# key: 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC/NMu0wZA3rOxpEeOaMBZXha+cdJakHZZOj4UQIglfQ/d+f/bzWcY/qqOsoI9SqqZby4eqoS3cCnXPFQ7dUec6Yl69ktroJ7pVcquKuzMKqyDA+voKntYGI2GwM6R802RaEw+mqeOtR7HDEqdpn7d/XTwfWbFXcZu2JoWzm/XyRlxCnTyblZSucGIwUugkTRp/Uu049ACL3hOsniB6ic0u1+n6IBxbTFU4RRO1qesKyHncxFELh3uKMh18CSFZwY7Ok25HoDBskFsYD9nsLv/BRIAbfWToDedNsL00l3dlUrQB7mo85aFPAxs3+4xwUxeaCIzYd34NCPujLpRSRjQd elmo@srv3l1126'