From 7dbb98c1cd5c6125da0726acf9dfb6109089c389 Mon Sep 17 00:00:00 2001 From: Jason Ernst Date: Sat, 10 Apr 2021 14:08:46 -0700 Subject: [PATCH] ensure there is a jason user, added crontab to backup website --- README.md | 2 ++ ansible/roles/common/tasks/main.yml | 13 +++++++++++++ ansible/site.yml | 7 +++++++ 3 files changed, 22 insertions(+) diff --git a/README.md b/README.md index 3161e76..c19b5f1 100644 --- a/README.md +++ b/README.md @@ -86,6 +86,8 @@ Deploy to ubuntu-server: Deploy to entire lan: +Deploy to www.jasonernst.com: +`ansible-playbook -i ansible/inventories/production/hosts.yml ansible/site.yml -u root --vault-password-file=.vault_pass --limit www.jasonernst.com` ## Todo: - setup local dns on lan (so we can reach devices by hostname instead of ip) diff --git a/ansible/roles/common/tasks/main.yml b/ansible/roles/common/tasks/main.yml index a12c156..68af54c 100644 --- a/ansible/roles/common/tasks/main.yml +++ b/ansible/roles/common/tasks/main.yml @@ -35,6 +35,19 @@ apply: become: true +- name: Add the user 'jason' + become: true + ansible.builtin.user: + name: jason + comment: Jason Ernst + +- name: adding jason to group sudo + become: true + user: + name: jason + groups: sudo + append: true + - name: adding jason to group docker become: true user: diff --git a/ansible/site.yml b/ansible/site.yml index d89d9ac..3a636d4 100644 --- a/ansible/site.yml +++ b/ansible/site.yml @@ -58,6 +58,13 @@ LETSENCRYPT_HOST: "www.jasonernst.com,jasonernst.com" LETSENCRYPT_EMAIL: "ernstjason1@gmail.com" + - name: Adds a crontab entry to to backup website + ansible.builtin.cron: + name: "backup www.jasonernst.com" + minute: "0" + hour: "3" + job: "rsync -av --delete /opt/goblog/prod/ home.jasonernst.com:/storage/backup/www.jasonernst.com/" + - name: Create Ombi Directories file: path: /etc/ombi