Skip to content

Commit

Permalink
Merge pull request #41 from bgraef/main
Browse files Browse the repository at this point in the history
add and update olam install steps
  • Loading branch information
bgraef authored Nov 13, 2024
2 parents d4ba719 + 6a84fb3 commit 7a46c29
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 16 deletions.
4 changes: 3 additions & 1 deletion olam/create_instance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,9 @@
ansible.builtin.include_tasks: deploy-olam-tasks.yml
vars:
control_node_ip: "{{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }}"
when: inventory_hostname == 'olam-node'
when:
- inventory_hostname in groups['control']
- olam_single_host

- name: Update all rpm packages
ansible.builtin.import_playbook: update_all_rpms.yml
Expand Down
3 changes: 2 additions & 1 deletion olam/default_vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ block_volume_size_in_gbs: 50
block_count: 1

update_all: false
passwordless_ssh: true
passwordless_ssh: true
olam_single_host: false
28 changes: 17 additions & 11 deletions olam/deploy-olam-tasks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
- python3-pyOpenSSL
- python3-pip
enablerepo: ol8_developer_EPEL
state: latest
state: present

- name: Install pexpect using pip
ansible.builtin.pip:
Expand All @@ -46,6 +46,7 @@
stream=13
profiles=
state=enabled
mode: '0644'
when:
- ansible_distribution_major_version | int >= 8

Expand All @@ -60,7 +61,7 @@
owner: "postgres"
group: "postgres"
state: directory
mode: "0700"
mode: '0700'

# Handle the ol-automation-manager-DB-init.sh script

Expand All @@ -69,11 +70,13 @@
path: "/var/lib/pgsql/data/PG_VERSION"
register: pgdata_dir_version

- name: initialize postgresql database
- name: Initialize postgresql database
ansible.builtin.command: "postgresql-setup --initdb"
when: not pgdata_dir_version.stat.exists
become: true
become_user: postgres
register: dbsetup_result
changed_when: dbsetup_result.rc == 0

- name: Change database password storage encryption
ansible.builtin.replace:
Expand All @@ -99,6 +102,7 @@
community.postgresql.postgresql_db:
name: awx
owner: awx
become: true
become_user: postgres

- name: Update host-based authentication
Expand All @@ -125,20 +129,20 @@
state: present

- name: Disable Oracle Linux Automation Manager 1.0 repository
ansible.builtin.ini_file:
community.general.ini_file:
path: "/etc/yum.repos.d/oraclelinux-automation-manager-ol8.repo"
section: ol8_automation1
option: enabled
value: "0"
mode: "0644"
mode: '0644'

- name: Enable Oracle Linux Automation Manager 2.0 repository
ansible.builtin.ini_file:
community.general.ini_file:
path: "/etc/yum.repos.d/oraclelinux-automation-manager-ol8.repo"
section: ol8_automation2
option: enabled
value: "1"
mode: "0644"
mode: '0644'

- name: Install Oracle Linux Automation Manager
ansible.builtin.dnf:
Expand Down Expand Up @@ -251,19 +255,19 @@

- name: Remove default server section in nginx configuration
ansible.builtin.template:
src: ../templates/nginx.conf.j2
src: nginx.conf.j2
dest: /etc/nginx/nginx.conf
owner: root
group: root
mode: "0644"
mode: '0644'

- name: Remove default configuration in receptor
ansible.builtin.template:
src: ../templates/receptor.conf.j2
src: receptor.conf.j2
dest: /etc/receptor/receptor.conf
owner: root
group: root
mode: "0644"
mode: '0644'

- name: Set firewall service rules
ansible.posix.firewalld:
Expand Down Expand Up @@ -301,4 +305,6 @@

- name: Enable lingering is needed
ansible.builtin.command: "loginctl enable-linger awx"
register: linger_result
changed_when: linger_result.rc == 0
when: not user_lingering.stat.exists
6 changes: 3 additions & 3 deletions olam/olam_passwordless_setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,6 @@
become_user: "{{ username }}"
register: result
changed_when: result.rc == 0
when:
- "'remote' in groups"
- inventory_hostname in groups['control']
when:
- "'remote' in groups"
- inventory_hostname in groups['control']

0 comments on commit 7a46c29

Please sign in to comment.