Skip to content

Commit

Permalink
Merge pull request #37 from jromers/new_olam_single
Browse files Browse the repository at this point in the history
Updated OLAM single node playbooks
  • Loading branch information
scoter-oracle authored Apr 11, 2024
2 parents 8729800 + 6d34b0e commit 303f888
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 57 deletions.
17 changes: 2 additions & 15 deletions playbooks/OLAM/single-node/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ It configures a single node with the following roles:

1. You have one Oracle Linux 8 host running
1. You have setup the required OpenSSH keys
1. You have the necessary permissions and access
1. You have the necessary permissions and access for the target host user with sudo access

### Pre-requisites

Expand All @@ -39,29 +39,16 @@ It configures a single node with the following roles:
1. Edit the group variables:
```
# Create Linux non-opc user account for installing Oracle Linux Automation Manager
"username": oracle
# Enter the non-hashed password for the non-opc user account.
"user_default_password": oracle
# Enter the password for postgress awx user
"awx_pguser_password": password
# Enter the password for postgress awx user
# Enter the password for OLAM admin user
"olam_admin_password": admin
# NOTE: use these passwords for demo purposes only, use other ansible features to
# protect your passwords such as using ansible-vault to encrypt passwords.
# Enter the name of a local ssh keypair located in the ~/.ssh directory. This key appends
# to the non-opc user account's authorized_keys file.
"ssh_keyfile": id_rsa
```
This file also contains a variable for setting a proxy if required to reach the internet from the Oracle Linux Automation Manager nodes.
Expand Down
12 changes: 0 additions & 12 deletions playbooks/OLAM/single-node/group_vars/all.yml.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,6 @@
# File: group_vars/all.yml
# Description: group_vars for "all" hosts in the inventory file

# Create Linux non-opc user account for installing Oracle Linux Automation Manager

"username": oracle

# Enter the non-hashed password for the non-opc user account.

"user_default_password": oracle

# Enter the password for postgress awx user

Expand All @@ -21,11 +14,6 @@
# NOTE: use these passwords for demo purposes only, use other ansible features to
# protect your passwords such as using ansible-vault to encrypt passwords.

# Enter the name of a local ssh keypair located in the ~/.ssh directory. This key appends
# to the non-opc user account's authorized_keys file.

"ssh_keyfile": id_rsa

# Set proxy if needed
# Uncomment both the pip_proxy_env and proxy_env sections, and set the proxy host and port accordingly.

Expand Down
30 changes: 0 additions & 30 deletions playbooks/OLAM/single-node/install.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,4 @@
---
- name: Create oracle user to run tasks on target host
hosts: all
become: yes

tasks:

- name: add user account with access to sudo
user:
name: "{{ username }}"
password: "{{ user_default_password | password_hash('sha512') }}"
comment: Ansible created user
groups: wheel
append: yes
update_password: on_create

- name: set authorized key for user using local pubilc key file
authorized_key:
user: "{{ username }}"
state: present
key: "{{ lookup('file', lookup('env','HOME') + '/.ssh/{{ ssh_keyfile }}.pub') }}"

- name: set user with passwordless sudo access
lineinfile:
path: '/etc/sudoers.d/{{ username }}'
regexp: '{{ username }} ALL='
line: '{{ username}} ALL=(ALL:ALL) NOPASSWD: ALL'
state: present
create: yes


# Install required packages on hosts

- name: Install required packages on hosts
Expand Down

0 comments on commit 303f888

Please sign in to comment.