Configures a Linux machine to the corporate base image from default install media with a minimal install
Find a file
2026-01-13 06:32:18 -07:00
collections Adding collection requirements 2021-09-27 06:44:24 -06:00
roles/base Swapping to ansible_facts variables 2026-01-13 06:32:18 -07:00
.gitignore Initial commit 2021-08-31 06:08:53 -06:00
base.yml Initial commit 2021-09-01 17:31:49 -06:00
hosts.yml Cleaning up inventory 2023-02-04 07:21:38 -07:00
README.md Swapping to ansible_facts variables 2026-01-13 06:32:18 -07:00
site.yml Initial commit 2021-09-01 17:31:49 -06:00

Ansible-Linux_Base

Configures a Linux machine to the corporate base image from default install media with a minimal install

Requirements

If the "base_core_hostname" variable is defined, it is recommended to set the ansible_ssh_common_args variable for the host to the following setting so the regeneration of the SSH host keys will not cause an error.

Variable Value
ansible_ssh_common_args '-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no'

Example

Execute playbook with needed variables

ansible-playbook -i hosts site.yml --ask-pass --ask-become-pass

Inventory File:

---
# file: hosts.yml

all:
  hosts:
    Server1:
      ansible_host: 192.168.0.10
      base_core_hostname: "Server1"

  vars:
    ansible_user: ansible
    ansible_ssh_common_args: '-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no'
    base_users: 
      - username: ansibleAwx
        disable_password: true
        ssh_keys: 
          - 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFWSvDHbKfZPHsagxj+FEQY7zxbhxjL75s1GE1HOoqWj ansibleAwx'
        ssh_keys_force: true
        groups:
          - "wheel"

Tags

Available tags for the role:

Role Tags
Base all, authorized_key, automatic_updates, cert, firewall, hostname, kernel, motd, password_auth, root_ca, root_login, ssh, time_sync, users, web_management