From c2f35608fc7ba9436f6d03acc5648f0e6597d09c Mon Sep 17 00:00:00 2001 From: Nicolas Meienberger <47644445+meienberger@users.noreply.github.com> Date: Fri, 8 Apr 2022 14:50:16 +0000 Subject: [PATCH 1/3] Create README.md --- README.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 00000000..58610116 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +[![forthebadge](https://forthebadge.com/images/badges/works-on-my-machine.svg)](https://forthebadge.com) From 2161dc030a6d1e69ae8e95daded16c169339e212 Mon Sep 17 00:00:00 2001 From: Nicolas Meienberger <47644445+meienberger@users.noreply.github.com> Date: Fri, 8 Apr 2022 14:55:17 +0000 Subject: [PATCH 2/3] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 58610116..9699df92 100644 --- a/README.md +++ b/README.md @@ -1 +1 @@ -[![forthebadge](https://forthebadge.com/images/badges/works-on-my-machine.svg)](https://forthebadge.com) +[![forthebadge](https://svgshare.com/i/g4Y.svg)](https://forthebadge.com) From 498269a7ebf29a86a2b684a65bfd6bfa3ffdbed9 Mon Sep 17 00:00:00 2001 From: Nicolas Meienberger Date: Fri, 15 Apr 2022 12:26:17 +0000 Subject: [PATCH 3/3] Fix build for debian --- ansible/host_vars/tipi.yml | 4 ++-- ansible/tasks/common/docker.yml | 18 +++++++++++++++++- ansible/tasks/common/essential.yml | 19 +++++++++---------- ansible/tasks/common/system-api.yml | 2 +- scripts/configure.sh | 8 +++++--- scripts/start.sh | 1 + 6 files changed, 35 insertions(+), 17 deletions(-) diff --git a/ansible/host_vars/tipi.yml b/ansible/host_vars/tipi.yml index 0aa0246f..4b7cf69a 100644 --- a/ansible/host_vars/tipi.yml +++ b/ansible/host_vars/tipi.yml @@ -5,9 +5,9 @@ packages: - iptables - coreutils - git - - base-devel + # - base-devel - docker - - avahi + - avahi-daemon - nodejs - npm diff --git a/ansible/tasks/common/docker.yml b/ansible/tasks/common/docker.yml index eb1114e4..210aef19 100644 --- a/ansible/tasks/common/docker.yml +++ b/ansible/tasks/common/docker.yml @@ -1,8 +1,24 @@ - name: Install docker package: - name: docker + name: + - docker + - ca-certificates + - curl + - gnupg + - lsb-release state: latest +- name: Add docker gpg key + shell: curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg + +- name: Add deb + shell: echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian bullseye stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null + +- name: Update packages + apt: + update_cache: yes + upgrade: yes + - name: Install essential packages package: name: diff --git a/ansible/tasks/common/essential.yml b/ansible/tasks/common/essential.yml index eed7985e..b36815d4 100644 --- a/ansible/tasks/common/essential.yml +++ b/ansible/tasks/common/essential.yml @@ -1,22 +1,21 @@ - name: Change machine hostname to tipi.local shell: hostnamectl set-hostname tipi.local -- name: Update packages - become: yes - pacman: - update_cache: yes - upgrade: yes - -- name: Add user to root group - user: - name: "{{ username }}" - group: root +# - name: Update packages +# apt: +# update_cache: yes +# upgrade: yes - name: Install essential packages package: name: "{{ packages }}" state: latest +- name: Add user to root group + user: + name: "{{ username }}" + group: root + - name: Disable SSH password auth lineinfile: dest: /etc/ssh/sshd_config diff --git a/ansible/tasks/common/system-api.yml b/ansible/tasks/common/system-api.yml index 478f574b..119219b2 100644 --- a/ansible/tasks/common/system-api.yml +++ b/ansible/tasks/common/system-api.yml @@ -1,6 +1,6 @@ - name: Install "pm2" package globally. community.general.npm: - name: yarn + name: pm2 global: yes - name: Run pm2 first time diff --git a/scripts/configure.sh b/scripts/configure.sh index 1f204fef..051f80ec 100755 --- a/scripts/configure.sh +++ b/scripts/configure.sh @@ -1,3 +1,6 @@ +#!/usr/bin/env bash +set -e # Exit immediately if a command exits with a non-zero status. + ROOT_FOLDER="$(readlink -f $(dirname "${BASH_SOURCE[0]}")/..)" # Constants @@ -33,10 +36,9 @@ ENV_FILE="./templates/.env" # Install ansible if not installed if ! command -v ansible-playbook > /dev/null; then echo "Installing Ansible..." - sudo apt-get install -y software-properties-common - sudo apt-add-repository -y ppa:ansible/ansible sudo apt-get update - sudo apt-get install -y ansible + sudo apt-get install python3 python3-pip -y + sudo pip3 install ansible fi ansible-playbook ansible/setup.yml -i ansible/hosts -K diff --git a/scripts/start.sh b/scripts/start.sh index 4032cfe3..0f5fcf25 100755 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -1,4 +1,5 @@ #!/usr/bin/env bash +set -e # Exit immediately if a command exits with a non-zero status. # use greadlink instead of readlink on osx if [[ "$(uname)" == "Darwin" ]]; then