Last active
May 6, 2021 01:13
-
-
Save pmkuny/a3be1bc795b11ed7fd3ec961cd2acf84 to your computer and use it in GitHub Desktop.
Ansible Bootstrap Development
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| - 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