Better ansible, also admin account on install.

master
Kaitlyn Parkhurst 3 years ago
parent 19ba7686d9
commit 78c7a18bb7
  1. 11
      README.md
  2. 6
      ansible/env/example/inventory.yml
  3. 1
      ansible/env/example/vault.yml
  4. 2
      ansible/roles/mjb-profile-panel/tasks/main.yml
  5. 30
      ansible/roles/mjb-profile-store/tasks/main.yml
  6. 29
      ansible/roles/mjb-role-webapp/tasks/webapp.yml

@ -199,16 +199,9 @@ Before proceeding from this section, review the section checklist to ensure you
### Configure The Panel ### Configure The Panel
I need to create an account on the panel, https://panel.mjb-stage.com/register with the email address manager@mjb-stage.com. 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:`.
Once I create the account, I need to promote it to an admin. From a shell on panel.mjb-stage.com server, I run the following. Now that I have the admin account credentials, I can access the Servers tab at https://panel.mjb-stage.com/admin/servers
```bash
cd mjb/Web
./script/mjb flip_admin manager@mjb-stage.com
```
Now that I have an admin account, I can access the Servers tab at https://panel.mjb-stage.com/admin/servers
The tab configures web servers that the system will deploy blogs to. Each of the webservers that were configures by Ansible should go here, so I enter `web-west.mjb-stage.com` and then `web-west.mjb-stage.com`. The servers tab now lists these two servers. The tab configures web servers that the system will deploy blogs to. Each of the webservers that were configures by Ansible should go here, so I enter `web-west.mjb-stage.com` and then `web-west.mjb-stage.com`. The servers tab now lists these two servers.

@ -17,6 +17,12 @@
all: all:
vars: vars:
# This is the admin user account that will be created for the panel.
admin_user:
name: Manager
email: manager@example.com
pass: "{{ vault_admin_user_pass }}"
# This is the git repository that contains MyJekyllBlog itself. It will be checked out # This is the git repository that contains MyJekyllBlog itself. It will be checked out
# during the installation process on the various machines that need it. # during the installation process on the various machines that need it.
repo: https://git.modfoss.com/symkat/MyJekyllBlog.git repo: https://git.modfoss.com/symkat/MyJekyllBlog.git

@ -1,3 +1,4 @@
vault_admin_user_pass: 'password you will use to login to the admin account on the panel'
vault_databases_mjb_pass: 'some password' vault_databases_mjb_pass: 'some password'
vault_databases_minion_pass: 'some password' vault_databases_minion_pass: 'some password'
vault_databases_gitea_pass: 'some password' vault_databases_gitea_pass: 'some password'

@ -34,5 +34,3 @@
- name: Support an nginx web server for MJB::Web - name: Support an nginx web server for MJB::Web
include_tasks: include_tasks:
file: webserver.yml file: webserver.yml
# Need to import the database TODO: Make the store server do this instead.

@ -20,9 +20,35 @@
name: mjb-role-webapp name: mjb-role-webapp
- name: Populate the MJB Database - name: Populate the MJB Database
shell: /home/manager/mjb/Web/script/mjb dbc < /home/manager/mjb/DB/etc/schema.sql > /home/manager/mjb/DB/etc/schema.log 2>&1 shell: /home/manager/mjb/Web/script/mjb dbc < /home/manager/mjb/DB/etc/schema.sql > /home/manager/.build-logs/schema.log 2>&1
args: args:
creates: /home/manager/mjb/DB/etc/schema.log creates: /home/manager/.build-logs/schema.log
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: Create initial admin user account
shell: /home/manager/mjb/Web/script/mjb create-user "{{ admin_user.name }}" "{{ admin_user.email }}" "{{ admin_user.pass }}" > /home/manager/.build-logs/user-create.log 2>&1
args:
creates: /home/manager/.build-logs/user-create.log
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: Promote initial admin user account to admin
shell: /home/manager/mjb/Web/script/mjb flip-admin "{{ admin_user.email }}" > /home/manager/.build-logs/flip-admin.log 2>&1
args:
creates: /home/manager/.build-logs/flip-admin.log
environment: environment:
PATH: '/home/manager/perl5/bin:/usr/local/bin:/usr/bin:/bin' PATH: '/home/manager/perl5/bin:/usr/local/bin:/usr/bin:/bin'
PERL5LIB: '/home/manager/perl5/lib/perl5' PERL5LIB: '/home/manager/perl5/lib/perl5'

@ -23,11 +23,19 @@
become: true become: true
become_user: manager become_user: manager
- name: Create /home/manager/.build-logs
file:
state: directory
path: /home/manager/.build-logs
owner: manager
group: manager
mode: 0750
- name: Build MJB::DB - name: Build MJB::DB
shell: dzil build > build.log 2>&1 shell: dzil build > /home/manager/.build-logs/mjb-db.log 2>&1
args: args:
chdir: /home/manager/mjb/DB chdir: /home/manager/mjb/DB
creates: /home/manager/mjb/DB/build.log creates: /home/manager/.build-logs/mjb-db.log
environment: environment:
PATH: '/home/manager/perl5/bin:/usr/local/bin:/usr/bin:/bin' PATH: '/home/manager/perl5/bin:/usr/local/bin:/usr/bin:/bin'
PERL5LIB: '/home/manager/perl5/lib/perl5' PERL5LIB: '/home/manager/perl5/lib/perl5'
@ -51,11 +59,24 @@
become: true become: true
become_user: manager 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: Install MJB::Web Dependencies - name: Install MJB::Web Dependencies
shell: cpanm --installdeps . > build.log 2>&1 shell: cpanm --installdeps . > /home/manager/.build-logs/mjb-web.log 2>&1
args: args:
chdir: /home/manager/mjb/Web chdir: /home/manager/mjb/Web
creates: /home/manager/mjb/Web/build.log creates: /home/manager/.build-logs/mjb-web.log
environment: environment:
PATH: '/home/manager/perl5/bin:/usr/local/bin:/usr/bin:/bin' PATH: '/home/manager/perl5/bin:/usr/local/bin:/usr/bin:/bin'
PERL5LIB: '/home/manager/perl5/lib/perl5' PERL5LIB: '/home/manager/perl5/lib/perl5'

Loading…
Cancel
Save