Refactor Freyfile
This commit is contained in:
parent
373001127c
commit
68ed4ebcf0
|
@ -1,5 +1,6 @@
|
|||
[global]
|
||||
appname = "infra-tusd"
|
||||
approot = "/srv/tusd"
|
||||
|
||||
[global.ssh]
|
||||
key_dir = "./ssh"
|
||||
|
@ -8,7 +9,7 @@
|
|||
become = true
|
||||
|
||||
[global.ansiblecfg.defaults]
|
||||
host_key_checking = "False"
|
||||
host_key_checking = false
|
||||
|
||||
[infra.provider.aws]
|
||||
access_key = "${var.FREY_AWS_ACCESS_KEY}"
|
||||
|
@ -79,10 +80,9 @@
|
|||
[[install.playbooks]]
|
||||
hosts = "infra-tusd-server"
|
||||
name = "Install infra-tusd-server"
|
||||
roles = [
|
||||
"{{{init.paths.roles_dir}}}/apt/v1.0.0",
|
||||
]
|
||||
[install.playbooks.vars]
|
||||
|
||||
[[install.playbooks.roles]]
|
||||
role = "{{{init.paths.roles_dir}}}/apt/v1.0.0"
|
||||
apt_packages = [
|
||||
"apg",
|
||||
"build-essential",
|
||||
|
@ -101,19 +101,37 @@
|
|||
]
|
||||
|
||||
[[install.playbooks.tasks]]
|
||||
action = "lineinfile dest=/home/ubuntu/.bashrc line=\"alias wtf='sudo tail -f /var/log/*{log,err} /var/log/{dmesg,messages,*{,/*}{log,err}}'\""
|
||||
lineinfile = "dest=/home/{{{config.global.ssh.user}}}/.bashrc line=\"alias wtf='sudo tail -f /var/log/*{log,err} /var/log/{dmesg,messages,*{,/*}{log,err}}'\" owner={{{config.global.ssh.user}}} group={{{config.global.ssh.user}}} mode=0644 backup=yes"
|
||||
name = "Common | Add convenience shortcut wtf"
|
||||
|
||||
[[install.playbooks.tasks]]
|
||||
lineinfile = "dest=/home/{{{config.global.ssh.user}}}/.bashrc line=\"cd {{{config.global.approot}}}/current || true\" owner={{{config.global.ssh.user}}} group={{{config.global.ssh.user}}} mode=0644 backup=yes"
|
||||
name = "Common | Install login"
|
||||
|
||||
[[install.playbooks.tasks]]
|
||||
name = "Common | Set motd"
|
||||
copy = "content='Welcome to {{lookup('env', 'FREY_DOMAIN')}}' dest=/etc/motd owner=root group=root mode=0644 backup=yes"
|
||||
|
||||
[[install.playbooks.tasks]]
|
||||
name = "Common | Set timezone variables"
|
||||
copy = "content='Etc/UTC' dest=/etc/timezone owner=root group=root mode=0644 backup=yes"
|
||||
notify = [ "Common | Update timezone" ]
|
||||
|
||||
[[install.playbooks.handlers]]
|
||||
name = "Common | Update timezone"
|
||||
command = "dpkg-reconfigure --frontend noninteractive tzdata"
|
||||
|
||||
|
||||
[[setup.playbooks]]
|
||||
hosts = "infra-tusd-server"
|
||||
name = "Setup infra-tusd"
|
||||
|
||||
[[setup.playbooks.tasks]]
|
||||
hostname = "name={{lookup('env', 'FREY_DOMAIN')}}"
|
||||
name = "infra-tusd | Set hostname"
|
||||
[[setup.playbooks.roles]]
|
||||
role = "{{{init.paths.roles_dir}}}/fqdn/v1.0.0"
|
||||
fqdn = "{{lookup('env', 'FREY_DOMAIN')}}"
|
||||
|
||||
[[setup.playbooks.tasks]]
|
||||
file = "path=/srv/tusd/shared/logs state=directory owner=www-data group=www-data mode=0755 recurse=yes"
|
||||
file = "path={{{config.global.approot}}}/shared/logs state=directory owner=www-data group=www-data mode=0755 recurse=yes"
|
||||
name = "infra-tusd | Create shared log dir"
|
||||
|
||||
[[setup.playbooks.tasks]]
|
||||
|
@ -127,24 +145,20 @@
|
|||
[[deploy.playbooks]]
|
||||
hosts = "infra-tusd-server"
|
||||
name = "Deploy infra-tusd"
|
||||
roles = [
|
||||
"{{{init.paths.roles_dir}}}/deploy/v1.4.0",
|
||||
]
|
||||
[deploy.playbooks.vars]
|
||||
|
||||
[[deploy.playbooks.roles]]
|
||||
role = "{{{init.paths.roles_dir}}}/deploy/v1.4.0"
|
||||
ansistrano_get_url = "https://github.com/tus/tusd/releases/download/0.1.2/tusd_linux_amd64.tar.gz"
|
||||
ansistrano_deploy_to = "/srv/tusd"
|
||||
ansistrano_deploy_to = "{{{config.global.approot}}}"
|
||||
ansistrano_deploy_via = "download_unarchive"
|
||||
ansistrano_npm = no
|
||||
ansistrano_owner = "www-data"
|
||||
ansistrano_group = "www-data"
|
||||
|
||||
[[deploy.playbooks.tasks]]
|
||||
copy = "src=../env.sh dest=/srv/tusd/current/env.sh mode=0600 owner=root group=root"
|
||||
copy = "src=../env.sh dest={{{config.global.approot}}}/current/env.sh mode=0600 owner=root group=root"
|
||||
name = "infra-tusd | Upload environment"
|
||||
|
||||
[[deploy.playbooks.tasks]]
|
||||
name = "tusd | Set file attributes"
|
||||
file = "path=/srv/tusd/current/tusd_linux_amd64/tusd mode=0755 owner=www-data group=www-data"
|
||||
file = "path={{{config.global.approot}}}/current/tusd_linux_amd64/tusd mode=0755 owner=www-data group=www-data"
|
||||
|
||||
[[restart.playbooks]]
|
||||
hosts = "infra-tusd-server"
|
||||
|
|
Loading…
Reference in New Issue