8000 N2T/ansible at v0.12.2 · CDLUC3/N2T · GitHub
[go: up one dir, main page]

Skip to content
< 8000 div data-color-mode="dark" data-light-theme="light" data-dark-theme="dark">

Latest commit

 

History

History

ansible

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Ansible Playbook deploy_n2t

The deploy_n2t.yaml ansible playbook works in consort with the UC3 puppet module uc3_ezid_n2t to perform end-to-end deployment of the n2t service on AWS EC2 hosts.

What it Does

  • Clone n2t repository into deployment directory /ezid/n2t
  • Install n2t app into virtual environment at /ezid/n2t/venv.
  • Post site configuration data (unit.json) into nginx-unit config api.

Usage

Execute this playbook on the localhost as user ezid:

cd ~/install/n2t/ansible
export ANSIBLE_STDOUT_CALLBACK=debug

ansible-playbook -i hosts deploy_n2t.yaml -CD
ansible-playbook -i hosts deploy_n2t.yaml

By default the playbook clones the main branch of the n2t repository into the deployment directory. To Deploy a specific version of the n2t application, supply the version number (git tag) on the command line as variable n2t_version:

ansible-playbook -i hosts deploy_n2t.yaml -e n2t_version=0.7.0

Updating a development deployment can be done without puppet (only applies to the dev server). After logging in as ezid user:

cd ~/install/n2t/ansible
export ANSIBLE_STDOUT_CALLBACK=debug
ansible-playbook -i hosts -e n2t_version=develop deploy_n2t.yaml

The develop value can be any branch or tag name.

After successful deployment, restart the unit application by either restarting the unit service:

sudo cdlsysctl restart unit

or restarting the application:

curl -X GET --unix-socket /var/run/unit/control.sock http://localhost/control/applications/n2t/restart | jq '.'

Prereqs (deployed by puppet)

  • nginx unit rpms:

    • unit
    • unit-devel
    • unit-python311
  • python3.11 rpms from Amzn repo:

    • python3.11
    • python3.11-libs
    • python3.11-setuptools
    • python3.11-pip
    • python3.11-tkinter
  • systemd dropin file for unit.service. This provides:

    • service runs as group ezid
    • pid file group ownership as ezid
    • log file group ownership as ezid
    • unit service unix socket writable by ezid
  • ansible binaries installed local to ezid user using pip3.11.

Debugging

To retrieve the current unit config object, run this curl as user ezid:

curl --unix-socket /var/run/unit/control.sock http://localhost/config

To check the status of the Nginx Unit service:

sudo cdlsysctl status unit
0