Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
ampledata committed Jan 17, 2023
1 parent 515e133 commit 30b0f78
Show file tree
Hide file tree
Showing 10 changed files with 39 additions and 163 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,9 @@ Ansible Playbooks for installing TAK Server
ansible-playbook tasks/main.yml -i ../inventory.yaml --vault-password-file=../vault.txt -e '@../secret' -l mytakserver
```

## Usage:

1. Download the TAK Server RPM from tak.gov
2. Copy the TAK Server RPM to takserver/tasks/files
3. Specify the TAK Server RPM name when calling this role.

4 changes: 4 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
takserver_rpm: |
You must specify the TAK Server RPM in the
takserver_rpm variable.
113 changes: 0 additions & 113 deletions tasks/certbot.yml

This file was deleted.

2 changes: 1 addition & 1 deletion tasks/install-epel.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
- name: Enable EPEL repository on CentOS 7 and RHEL 7
when: ansible_facts['os_family'] == 'RedHat' and ansible_facts['distribution_major_version'] == '7'
become: true
yum:
name: epel-release
state: latest
when: ansible_facts['os_family'] == 'RedHat' and ansible_facts['distribution_major_version'] == '7'
2 changes: 1 addition & 1 deletion tasks/install-psql.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
- name: Install postgres from yum repository on CentOS 7 and RHEL 7
when: ansible_facts['os_family'] == 'RedHat' and ansible_facts['distribution_major_version'] == '7'
yum:
name: https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
state: latest
when: ansible_facts['os_family'] == 'RedHat' and ansible_facts['distribution_major_version'] == '7'
6 changes: 3 additions & 3 deletions tasks/install-takserver.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
- name: Copy TAK Server RPM
copy:
src: takserver-4.7-RELEASE20.noarch.rpm
dest: takserver-4.7-RELEASE20.noarch.rpm
src: "{{ takserver_rpm }}"
dest: "{{ takserver_rpm }}"

- name: Install TAK Server
yum:
name: takserver-4.7-RELEASE20.noarch.rpm
name: "{{ takserver_rpm }}"
state: latest
40 changes: 12 additions & 28 deletions tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,13 @@
---
- name: Install TAK Server
hosts: all
tasks:
- name: Linux | Prerequisite | Increases TCP connection limit
import_tasks: update-ulimit.yml

- name: Linux | Prerequisite | Update yum cache
import_tasks: yum-update.yml

- name: Linux | Prerequisite | Install EPEL
import_tasks: install-epel.yml

- name: Linux | Prerequisite | Update yum cache (after adding EPEL)
import_tasks: yum-update.yml

- name: PostgreSQL | Install
import_tasks: install-psql.yml

- name: TAK Server | Install
import_tasks: install-takserver.yml

- name: TAK Server | Setup DB
import_tasks: setup-takserver-db.yml

- name: TAK Server | Enable & start service
import_tasks: enable-start-takserver.yml


tags: takserver
include_tasks: "{{ item }}"
loop:
- update-ulimit.yml
- update-yum.yml
- install-epel.yml
- update-yum.yml
- install-psql.yml
- install-takserver.yml
- setup-takserver-db.yml
- enable-start-takserver.yml
when: ansible_distribution == "CentOS"
16 changes: 5 additions & 11 deletions tasks/setup-takserver-db.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
---
- name: Check if takserver_db_setup.done exists
- name: Check if TAK PostgreSQL Database exists
stat:
path: takserver_db_setup.done
register: takserver_db_setup
path: /var/lib/pgsql/10/data/
register: takserver_db_data

- name: Setup TAK DB
- name: Setup TAK PostgreSQL Database
shell: /opt/tak/db-utils/takserver-setup-db.sh
when: not takserver_db_setup.stat.exists

- name: Touch takserver_db_setup.done
file:
path: takserver_db_setup.done
state: touch
when: not takserver_db_setup.stat.exists
when: not takserver_db_data.stat.exists
7 changes: 7 additions & 0 deletions tasks/update-yum.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
- name: Update repository index (CentOS)
tags: always
ansible.builtin.yum:
update_cache: true
changed_when: false
when: ansible_distribution == "CentOS"
6 changes: 0 additions & 6 deletions tasks/yum-update.yml

This file was deleted.

0 comments on commit 30b0f78

Please sign in to comment.