diff --git a/README.md b/README.md new file mode 100644 index 00000000..9699df92 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +[![forthebadge](https://svgshare.com/i/g4Y.svg)](https://forthebadge.com) diff --git a/ansible/host_vars/tipi.yml b/ansible/host_vars/tipi.yml index d76530b5..fb610bf7 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 # - libusb diff --git a/ansible/tasks/common/docker.yml b/ansible/tasks/common/docker.yml index 175e5fa1..485adabf 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 51f90e66..a52f42d0 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