guess username (#23086)

This commit is contained in:
Christophe Siraut 2018-04-11 09:39:22 +02:00
parent fd1148098c
commit c7a55a57a8
5 changed files with 16 additions and 1 deletions

View File

@ -3,6 +3,9 @@
hosts: local
vars:
venv_bin: "{{venv}}/bin"
roles:
- facts
tasks:
- name: "delete hobo tenant"
command: "{{venv_bin}}/{{apps['hobo']['project_name']}}-manage delete_tenant {{tenants_conf['dev-hobo']}}"

View File

@ -2,6 +2,7 @@
- name: deploy publik tenants for local developement
hosts: local
roles:
- facts
- deploy-tenants
vars:
venv_bin: "{{venv}}/bin"

View File

@ -6,7 +6,7 @@ src_dir: "/home/{{user}}/src"
ssl_certificate: "{{venv_certs}}/dev.publik.love-fullchain.pem"
ssl_certificate_key: "{{venv_certs}}/dev.publik.love-privkey.pem"
venv: "/home/{{user}}/envs/publik-env"
user: publik
user: your_user_name
apps:
authentic:
db_name: authentic_multitenant

View File

@ -2,6 +2,7 @@
- name: publik multitenants installation
hosts: local
roles:
- facts
- base
- hobo
- authentic

View File

@ -0,0 +1,10 @@
---
- name: guess username (can be overidden in options/inventory)
local_action: command whoami
when: user == 'your_user_name'
register: username
- name: set user variable
set_fact:
user: "{{ username.stdout }}"
when: user == 'your_user_name'