Skip to content

Instantly share code, notes, and snippets.

@pmkuny
Last active May 6, 2021 01:13
Show Gist options
  • Select an option

  • Save pmkuny/a3be1bc795b11ed7fd3ec961cd2acf84 to your computer and use it in GitHub Desktop.

Select an option

Save pmkuny/a3be1bc795b11ed7fd3ec961cd2acf84 to your computer and use it in GitHub Desktop.
Ansible Bootstrap Development
---
- name: bootstrap
hosts: localhost
connection: local
tasks:
- name: Update System
yum:
name: "*"
state: latest
- name: Install tools
yum:
name: "{{ packages }}"
vars:
packages:
- git
- python3-pip
- name: Ensure wheel group
group:
name: wheel
state: present
- name: Create User
user:
name: kunyp
groups: wheel
expires: -1
- name: Manage Key
authorized_key:
user: kunyp
state: present
key: "{{ ssh_key }}"
manage_dir: true
- name: Update Sudoers
lineinfile:
dest: /etc/sudoers.d/wheel
state: present
create: true
line: '%wheel ALL=(ALL) NOPASSWD: ALL'
- name: Sudoers File Permissions
file:
path: /etc/sudoers.d/wheel
owner: root
group: root
mode: '0600'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment