diff --git a/ansible/bootiful.yml b/ansible/bootiful.yml new file mode 100644 index 0000000000000000000000000000000000000000..b574ad215a5b21bd08dcde2d9ce9af65f7cd725d --- /dev/null +++ b/ansible/bootiful.yml @@ -0,0 +1,11 @@ +--- + +# Deploy bootiful server, tested on Debian 12 + +- hosts: bootiful_server + gather_facts: true + + tasks: + - include_vars: vars.yml + - import_tasks: configure_runtime.yml + - import_tasks: configure_app.yml diff --git a/ansible/configure_app.yml b/ansible/configure_app.yml new file mode 100644 index 0000000000000000000000000000000000000000..288bfc3e4ee2550623af550060303af7dc3a91d5 --- /dev/null +++ b/ansible/configure_app.yml @@ -0,0 +1,9 @@ + +- name: Git checkout bootiful project + become: false + ansible.builtin.git: + repo: "{{ git_repo }}" + dest: "{{ git_clone_dest }}" + version: "{{ git_branch }}" + register: git_checkout_result + diff --git a/ansible/configure_runtime.yml b/ansible/configure_runtime.yml new file mode 100644 index 0000000000000000000000000000000000000000..8ee27110519ec9af84bb2e8c3eaa3be0ca98d1d4 --- /dev/null +++ b/ansible/configure_runtime.yml @@ -0,0 +1,18 @@ +--- + +- name: Upgrade system + become: true + ansible.builtin.apt: + update_cache: true + upgrade: "yes" + +- name: Install system packages + become: true + ansible.builtin.apt: + pkg: + - python3-pip + - git + - build-essential + - docker.io + - docker-compose + state: latest diff --git a/ansible/hosts b/ansible/hosts new file mode 100644 index 0000000000000000000000000000000000000000..37dbf693f6f8e8901c4c4d9da654fb1e18bfb8d7 --- /dev/null +++ b/ansible/hosts @@ -0,0 +1,2 @@ +[bootiful_server] +bootiful_server_1 ansible_port=22 ansible_user=pierre ansible_host=bootiful-server diff --git a/ansible/run-ansible.sh b/ansible/run-ansible.sh new file mode 100644 index 0000000000000000000000000000000000000000..7d260ac337fdb0d531b3469e0135fe8fbb30de57 --- /dev/null +++ b/ansible/run-ansible.sh @@ -0,0 +1 @@ +ansible-playbook bootiful.yml -i hosts -Kk diff --git a/ansible/vars.yml b/ansible/vars.yml new file mode 100644 index 0000000000000000000000000000000000000000..b492a2961295117f17a7480076da842170570caf --- /dev/null +++ b/ansible/vars.yml @@ -0,0 +1,3 @@ +git_repo: "https://gitedu.hesge.ch/pierre.kunzli/bootiful.git" +git_branch: master +git_clone_dest: bootiful