More things.

master
Kaitlyn Parkhurst 3 years ago
parent c02eb8d9f5
commit 6b9ce4a0c2
  1. 2
      README.md
  2. 3
      ansible/README.md
  3. 12
      ansible/roles/mjb-profile-panel/files/stripe-backend.service
  4. 4
      ansible/roles/mjb-profile-panel/tasks/main.yml
  5. 29
      ansible/roles/mjb-profile-panel/tasks/stripe-backend.yml
  6. 7
      ansible/roles/mjb-role-webapp/templates/mjb.yml.j2
  7. 88
      ansible/update-software.yml

@ -199,7 +199,7 @@ Before proceeding from this section, review the section checklist to ensure you
### Configure The Panel ### Configure The Panel
An initial admin account is created during the ansible installation. The credentials for the admin account are in the `inventory.yml` file under `admin\_user:`. An initial admin account is created during the ansible installation. The credentials for the admin account are in the `inventory.yml` file under `admin_user:`.
Now that I have the admin account credentials, I can access the Servers tab at https://panel.mjb-stage.com/admin/servers Now that I have the admin account credentials, I can access the Servers tab at https://panel.mjb-stage.com/admin/servers

@ -19,6 +19,9 @@ ansible-vault edit --vault-password-file .vault_password env/stage/vault.yml
# Running the playbook to ensure everything is setup: # Running the playbook to ensure everything is setup:
ansible-playbook -i env/stage/inventory.yml --vault-password-file .vault_password -e @env/stage/vault.yml site.yml ansible-playbook -i env/stage/inventory.yml --vault-password-file .vault_password -e @env/stage/vault.yml site.yml
# Updateing MJB Software & Restarting mjb.panel, mjb.worker, and mjb.certbot
ansible-playbook -i env/stage/inventory.yml --vault-password-file .vault_password -e @env/stage/vault.yml update-software.yml
``` ```

@ -0,0 +1,12 @@
[Unit]
Description=Stripe Backend Server
After=network.target
[Service]
User=manager
Group=manager
WorkingDirectory=/home/manager/mjb/Web/script
ExecStart=/usr/bin/gunicorn --workers 3 --bind 127.0.0.1:8000 stripe-backend:app
[Install]
WantedBy=multi-user.target

@ -25,6 +25,10 @@
group: manager group: manager
mode: 0600 mode: 0600
- name: Support running stripe-backend
include_tasks:
file: stripe-backend.yml
- name: Start & enable mjb.panel - name: Start & enable mjb.panel
service: service:
name: mjb.panel name: mjb.panel

@ -0,0 +1,29 @@
- name: Install packages
apt:
name: [
'python3-pip',
'gunicorn',
]
state: present
- name: Install stripe-backend.service file.
copy:
dest: /etc/systemd/system/stripe-backend.service
src: "{{ role_path }}/files/stripe-backend.service"
owner: root
group: root
mode: 0644
- name: Install Python Packages
shell: pip3 install "{{ item }}"
become: true
become_user: manager
with_items:
- "flask"
- "stripe"
- name: Start Stripe Backend
service:
name: stripe-backend
state: restarted
enabled: true

@ -19,6 +19,13 @@ secrets:
- {{ secret }} - {{ secret }}
{% endfor %} {% endfor %}
stripe:
enable: {{ panel_config.stripe.enable }}
lookup_key: {{ panel_config.stripe.lookup_key }}
backend: {{ panel_config.stripe.backend }}
api_key: {{ panel_config.stripe.api_key }}
return_domain: https://{{ domain_name.panel }}
register: register:
# If a user clicks 'register' which system should they go to? # If a user clicks 'register' which system should they go to?
default: {{ panel_config.register.default }} default: {{ panel_config.register.default }}

@ -0,0 +1,88 @@
- name: Update MJB Software
remote_user: root
hosts:
- store
- buildservers
- panel
- certbot
vars:
ansible_ssh_common_args: -oControlMaster=auto -oControlPersist=60s -oUserKnownHostsFile=/dev/null -oStrictHostKeyChecking=no
tasks:
- name: "Get latest changes from {{ repo }}"
git:
repo: "{{ repo }}"
dest: /home/manager/mjb
accept_hostkey: true
become: true
become_user: manager
- name: Rebuild MJB::DB
shell: dzil build > /home/manager/.build-logs/mjb-db.log 2>&1
args:
chdir: /home/manager/mjb/DB
environment:
PATH: '/home/manager/perl5/bin:/usr/local/bin:/usr/bin:/bin'
PERL5LIB: '/home/manager/perl5/lib/perl5'
PERL_MB_OPT: '--install_base "/home/manager/perl5"'
PERL_MM_OPT: 'INSTALL_BASE=/home/manager/perl5'
PERL_LOCAL_LIB_ROOT: '/home/manager/perl5'
become: true
become_user: manager
- name: Reinstall MJB::DB
shell: cpanm MJB-DB-*.tar.gz
args:
chdir: /home/manager/mjb/DB
environment:
PATH: '/home/manager/perl5/bin:/usr/local/bin:/usr/bin:/bin'
PERL5LIB: '/home/manager/perl5/lib/perl5'
PERL_MB_OPT: '--install_base "/home/manager/perl5"'
PERL_MM_OPT: 'INSTALL_BASE=/home/manager/perl5'
PERL_LOCAL_LIB_ROOT: '/home/manager/perl5'
become: true
become_user: manager
- name: Clean MJB::DB
shell: dzil clean
args:
chdir: /home/manager/mjb/DB
environment:
PATH: '/home/manager/perl5/bin:/usr/local/bin:/usr/bin:/bin'
PERL5LIB: '/home/manager/perl5/lib/perl5'
PERL_MB_OPT: '--install_base "/home/manager/perl5"'
PERL_MM_OPT: 'INSTALL_BASE=/home/manager/perl5'
PERL_LOCAL_LIB_ROOT: '/home/manager/perl5'
become: true
become_user: manager
- name: Reload Panel Service
remote_user: root
hosts: panel
vars:
ansible_ssh_common_args: -oControlMaster=auto -oControlPersist=60s -oUserKnownHostsFile=/dev/null -oStrictHostKeyChecking=no
tasks:
- name: Restart mjb.panel
service:
name: mjb.panel
state: restarted
- name: Reload Certbot Worker
remote_user: root
hosts: certbot
vars:
ansible_ssh_common_args: -oControlMaster=auto -oControlPersist=60s -oUserKnownHostsFile=/dev/null -oStrictHostKeyChecking=no
tasks:
- name: Restart mjb.certbot
service:
name: mjb.certbot
state: restarted
- name: Reload Worker
remote_user: root
hosts: buildservers
vars:
ansible_ssh_common_args: -oControlMaster=auto -oControlPersist=60s -oUserKnownHostsFile=/dev/null -oStrictHostKeyChecking=no
tasks:
- name: Restart mjb.worker
service:
name: mjb.worker
state: restarted
Loading…
Cancel
Save