Skip to content

Commit

Permalink
Use real hostname
Browse files Browse the repository at this point in the history
  • Loading branch information
terrameijar committed Mar 13, 2024
1 parent a5b791c commit b0e3f7e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
10 changes: 8 additions & 2 deletions ansible/deploy.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
---

- hosts: localhost
- hosts: cybertron
gather_facts: true
become_user: "{{ ansible_user }}"

tasks:
- name: Deployment Stub
debug:
msg: "Simulated Deployment Successful!"
msg: "Simulated Deployment Successful!"
- name: Print Hostname
debug:
msg: "Hostname: {{ ansible_hostname }}"
4 changes: 2 additions & 2 deletions ansible/hosts
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
54.220.70.177

[cybertron:vars]
create_user=optimus
repo_folder="/home/{{create_user}}/chitchat"
ansible_user=optimus
repo_folder="/home/{{ansible_user}}/chitchat"
5 changes: 2 additions & 3 deletions ansible/roles/security/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

- name: Create regular user with sudo priviledges
user:
name: "{{create_user}}"
name: "{{ansible_user}}"
state: present
groups: prime
append: true
Expand All @@ -38,7 +38,7 @@

- name: Set authorised key for remote user
authorized_key:
user: "{{ create_user}}"
user: "{{ ansible_user}}"
state: present
key: "{{copy_local_ssh_key}}"

Expand Down Expand Up @@ -77,7 +77,6 @@
port: "{{ssh_port}}"
proto: tcp


- name: UFW - Deny all other incoming traffic by default
ufw:
state: enabled
Expand Down

0 comments on commit b0e3f7e

Please sign in to comment.