
About
This video provides instructions for using Ansible with Vagrant to provision an Oracle Linux 8 system with an additional user and ssh key.
Content:
This video discusses the steps needed to create an Ansible script for provisioning an additional user and ssh key beyond the defaults in the standard Oracle Linux Vagrant box deployment.
Prerequisites for this video include installing Vagrant, Ansible, VirtualBox, and the Oracle Vagrant Boxes available on GitHub.
Here are the contents of the playbook.yml covered in the video:
---
- hosts: all
become: yes
tasks:
- name: Add a user with access to sudo
user:
name: oracle
password: "{{ 'oracle' | password_hash('sha512') }}"
comment: Oracle User
groups: wheel
append: yes
update_password: on_create
- name: Set authorized key for user oracle copying it from current user
authorized_key:
user: oracle
state: present
key: "{{ lookup('file', lookup('env','HOME') + '/.ssh/id_rsa.pub') }}"
Click on the following link to access the video: