Skip to content

Commit

Permalink
Better SSH
Browse files Browse the repository at this point in the history
- role to add extra users
- more config for ssh connections
  • Loading branch information
wawrzek committed Aug 5, 2024
1 parent ed4aa90 commit 9b4f506
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ target/
.idea/

terraform.tfstate*
devops/ansible/roles/extra_ssh
devops/ansible/roles/extra_ssh/files/*
1 change: 1 addition & 0 deletions devops/ansible/ansible.cfg
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
[defaults]
inventory = inventory_aws_ec2.yml
host_key_checking = False
1 change: 1 addition & 0 deletions devops/ansible/group_vars/all.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
---
ansible_user: ec2-user
ansible_ssh_private_key_file: "~/.ssh/glove.prv"
9 changes: 9 additions & 0 deletions devops/ansible/roles/extra_ssh/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
- name: Set authorized key taken from file
ansible.posix.authorized_key:
user: ec2-user
state: present
key: "{{ lookup('file', item) }}"
loop:
- noah.pub
- shams.pub
6 changes: 6 additions & 0 deletions devops/ansible/users.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
- hosts: tag_Glove
become: true
gather_facts: true
roles:
- extra_ssh

0 comments on commit 9b4f506

Please sign in to comment.