1
0
Fork 0
home-stack-ansible/roles/common/tasks/main.yml

45 lines
912 B
YAML

- name: Perform system update
apt:
update_cache: yes
upgrade: 'yes'
- name: Install basic packages
apt:
name:
- curl
- vim
- tmux
- name: Set default editor to vim
lineinfile:
path: /etc/environment
line: EDITOR=vim
- name: Disable root login
user:
name: root
password: '*'
- name: Ensure sudoers is correctly configured
lineinfile:
path: /etc/sudoers
line: '%sudo ALL=(ALL:ALL) ALL'
regexp: '^%sudo\s+'
validate: '/usr/sbin/visudo -cf %s'
- name: Configure users
include_tasks: user.yml
with_dict: '{{ users }}'
- name: Configure hostname
hostname:
name: '{{ inventory_hostname }}'
# - name: Configure hostname in /etc/hosts
# blockinfile:
# dest: /etc/hosts
# marker: '# {mark} ANSIBLE MANAGED BLOCK HOSTNAME'
# block: |
# 127.0.0.1 {{ inventory_hostname }}
# ::1 {{ inventory_hostname }}