Reorganize inventory, add ansible system user

Who is only used on my desktop hosts, obviously
This commit is contained in:
Salt 2020-06-16 09:34:55 -05:00
parent f9826d2e9f
commit f0a61e9538
4 changed files with 74 additions and 46 deletions

View File

@ -4,6 +4,19 @@ all:
vars: vars:
ansible_user: ubuntu ansible_user: ubuntu
children: children:
home:
vars:
ansible_user: ansible
hosts:
dsk-cstm-0:
ansible_host: 172.23.100.1
lap-th-e560-0:
ansible_host: 172.23.100.2
9iron:
children:
ansiblehosts:
webservers:
gameservers:
ansiblehosts: ansiblehosts:
hosts: hosts:
9iron.club: 9iron.club:

View File

@ -0,0 +1,15 @@
#!/usr/bin/ansible-playbook
# vim:ft=ansible:
- name: Configure Ansible system user
block:
- name: Create Ansible system user
user:
name: ansible
groups: sudo
password_lock: yes
system: yes
- name: Add Ansible key to user
authorized_key:
user: ansible
manage_dir: yes
key: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQC8pjK7Z6V9IjxRtLB9Xwt5Rujj0iMQqOVExRkmkIzjEcblV/cqtwx4fOijoN9eQlmrjQg05rBWoHJoUiLH5LimU2HPQt9vSDSt/tTXNafhvi3St3nz+GA9yCwAkJfvz2QL/vnU7sfveYC2xmWZC0xjcG4bl8pL2GJgfyh4OnfS9vNRTpn1kAJ/Fl4vRLtRaFx1WzF3/RJUOkesYLegawSRJsaIamJFI5YxHe5VeTnFefVtssgbGrOj19uRDIZkBW/5uWsnNPVwbGUT089qioS11QFJaVOQCgU/E+4lxCHlRfLQ+gnXvaQV3j0JFk/I1bZNlCcNLHc0ZasXIqV+BUaR4au35QkDBjh38DCxesZ775tudXUp7KP6OHCC9i9ncIkum3mE+4K+0KAlS0oevUQdfguXkRQ6q3vydxEgWbBOx3jHi7i5AwvOnJqZRmUnfFp0qfhGfcS2pLEZhUcd0bOM6qAyK1XD5XRzXoVLS9bdHNUwCaIWie0tOYMLLmNooTU= ansible"

View File

@ -1,13 +1,14 @@
#!/usr/bin/ansible-playbook #!/usr/bin/ansible-playbook
# vim:ft=ansible: # vim:ft=ansible:
--- ---
- name: Configure basic system settings
block:
- name: Update and upgrade apt packages - name: Update and upgrade apt packages
apt: apt:
upgrade: "yes" upgrade: "yes"
update_cache: yes update_cache: yes
# One day # One day
cache_valid_time: 86400 cache_valid_time: 86400
become: yes
- name: Install basic packages - name: Install basic packages
apt: apt:
name: "{{ packages }}" name: "{{ packages }}"
@ -19,11 +20,9 @@
- python3-apt - python3-apt
- vim - vim
- awscli - awscli
become: yes
- name: Set timezone - name: Set timezone
timezone: timezone:
name: "America/Chicago" name: "America/Chicago"
become: yes
notify: restart cron notify: restart cron
- name: Configure MOTD - name: Configure MOTD
block: block:
@ -47,4 +46,5 @@
- "92-unattended-upgrades" - "92-unattended-upgrades"
- "95-hwe-eol" - "95-hwe-eol"
- "97-overlayroot" - "97-overlayroot"
become: yes - name: Configure Ansible user
include_tasks: ansibleuser.yml