Skip to content

Commit

Permalink
Sync with upstream definitions from datalab-ansible-terraform v0.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ml-evs committed Jan 6, 2025
1 parent d4a71ac commit 5e7ad32
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 4 deletions.
2 changes: 1 addition & 1 deletion ansible/roles/borg/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
ssh_config_defined: "{{ ssh_config.stat.exists }}"

- name: Sync local ssh config vault remote
become: true
when: ssh_config_defined
become: true
ansible.builtin.copy:
src: "{{ playbook_dir }}/vaults/borg/.ssh/"
dest: "{{ ansible_user_home_dir }}/borgmatic/.ssh"
Expand Down
20 changes: 20 additions & 0 deletions ansible/roles/datalab/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,24 @@
dest: "{{ ansible_user_home_dir }}/datalab/pydatalab/.env"
mode: "0644"

- name: Get git tag version locally to use as fact # noqa: command-instead-of-module
delegate_to: localhost
ansible.builtin.shell:
cmd: set -o pipefail && git describe --tags --match 'v*' | sed 's/^v//' | sed 's/-rc/rc/' | sed 's/-/+/'
chdir: "{{ playbook_dir }}/../src/datalab"
register: git_tag
changed_when: false

- name: Set fact for git tag version
ansible.builtin.set_fact:
git_tag: "{{ git_tag.stdout }}"

- name: Write git version to a .env file to be loaded by build
ansible.builtin.copy:
content: "SETUPTOOLS_SCM_PRETEND_VERSION={{ git_tag }}\nVUE_APP_GIT_VERSION={{ git_tag }}"
dest: "{{ ansible_user_home_dir }}/datalab/.env_version"
mode: "0644"

- name: Copy encrypted API config file from vault
ansible.builtin.copy:
src: "{{ playbook_dir }}/vaults/datalab/prod_config.json"
Expand All @@ -38,6 +56,7 @@
build: always
env_files:
- "{{ ansible_user_home_dir }}/datalab/pydatalab/.env"
- "{{ ansible_user_home_dir }}/datalab/.env_version"

- name: Check whether ssh config exists
ansible.builtin.stat:
Expand Down Expand Up @@ -85,6 +104,7 @@
build: always
env_files:
- "{{ ansible_user_home_dir }}/datalab/webapp/.env"
- "{{ ansible_user_home_dir }}/datalab/.env_version"

- name: Add daily backup task to crontab
ansible.builtin.cron:
Expand Down
2 changes: 1 addition & 1 deletion ansible/roles/ssl_first_run/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,6 @@
name: SSL renewal with certbot
minute: "38"
hour: "10"
day: "2"
weekday: "2"
month: "*"
job: docker run -v certbot-www:/var/www/certbot -v certbot-conf:/etc/letsencrypt certbot/certbot:latest renew
2 changes: 1 addition & 1 deletion src/datalab

0 comments on commit 5e7ad32

Please sign in to comment.