Migrated from legacy playbook repo into Ansible collection format: Roles (171 total): - common: 44 roles (fact gathering, SSH setup, utilities) - configuration: 32 roles (system config, networking, satellite) - provisioning: 16 roles (VMware, Azure, physical server deployment) - security: 15 roles (OpenSCAP hardening, certificates, AD integration) - monitoring: 12 roles (Zabbix, logging agents, metrics) - networking: 12 roles (DNS, DHCP, network interfaces) - satellite: 4 roles (Pulp/Satellite management) - misc: 36 roles (various utilities) Playbooks (159 total): - provisioning: 14 playbooks - azure: 13 playbooks - configuration: 22 playbooks - maintenance: 10 playbooks - security: 10 playbooks - monitoring: 9 playbooks - vcenter: 6 playbooks - networking: 7 playbooks - misc: 65 playbooks
58 lines
1.4 KiB
YAML
58 lines
1.4 KiB
YAML
---
|
|
# tasks file for create-infra-user
|
|
- include_vars: credentials.yml
|
|
|
|
- name: Create infra group
|
|
group:
|
|
name: infra
|
|
state: present
|
|
|
|
- name: Create Infra user
|
|
user:
|
|
name: infra
|
|
group: infra
|
|
shell: /bin/bash
|
|
createhome: yes
|
|
password: "{{ infra_pass }}"
|
|
|
|
- name: Ensure /home/infra is owned by infra (UID 150)
|
|
file:
|
|
path: /home/infra
|
|
state: directory
|
|
owner: infra
|
|
group: infra
|
|
|
|
- name: Create /etc/sudoers.d/admin
|
|
file:
|
|
path: /etc/sudoers.d/admin
|
|
state: touch
|
|
owner: root
|
|
group: root
|
|
mode: 0644
|
|
|
|
- name: Add Infra user to sudoers
|
|
lineinfile:
|
|
line: '%infra ALL=(ALL) ALL'
|
|
path: /etc/sudoers.d/admin
|
|
|
|
- name: Restart SSHD
|
|
service:
|
|
name: sshd.service
|
|
state: restarted
|
|
|
|
- name: Ensure /home/infra/.ssh exists
|
|
file:
|
|
state: directory
|
|
path: /home/infra/.ssh
|
|
owner: infra
|
|
group: infra
|
|
mode: 0600
|
|
|
|
- name: Configure SSH key login for infra user
|
|
authorized_key:
|
|
user: infra
|
|
state: present
|
|
key: |
|
|
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC/hwpWbOsvPQ1CXHQg3vIls4+cuVO4gM4uHyDNtVX+t8aDH5ofk2hCSczZwdZZVACEofl0vJYbGibpDTqEmfEEGG+/AqTM3+pcoHb2/TJhazaIUQAOk9CVnqqtfcrO8QtGSUJN4I+Jey7fn7aFFB7w6wYHN346jjvYtr2ckxpw/Mr6m9C9c0ks/c6bQQgLtrmK0griIMJxo0D4H2xkh/cCK+7Wy8iLTMN7BzQ5DPB1FQtLO2YPF1eHOjuY5qsmOEkRVHXG9QwCMzDpQePcz1M/GKSVZ+uFpSCeqzNvObhyX6eoysCYkBsU1EGJV3/dauzufKHKsjmNJO/AtMMR6yBP infra@linux-certs.EXAMPLE-CORP.COM
|
|
|