Removed absolute paths
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
read -p "Enter root password" password
|
||||
read -p "Enter root password : " password
|
||||
|
||||
# Update APT repos
|
||||
sudo apt update
|
||||
@@ -16,8 +16,7 @@ pipx ensurepath
|
||||
pipx install --include-deps ansible
|
||||
|
||||
# Install passlib (for ssh password connection)
|
||||
sudo apt install python3-passlib
|
||||
pipx inject ansible passlib
|
||||
sudo apt install sshpass
|
||||
|
||||
# Make sure git is installed
|
||||
sudo apt install git
|
||||
@@ -25,4 +24,4 @@ sudo apt install git
|
||||
# Clone ansible_playbooks repo
|
||||
git clone https://git.athelas-conseils.fr/Stage/ansible_playbooks.git
|
||||
|
||||
ansible-playbook ansible_playbooks/tasks/full_setup.yml -i ansible_playbooks/inventory.ini --extra-vars "ansible_ssh_pass=$password"
|
||||
~/.local/bin/ansible-playbook ansible_playbooks/tasks/full_setup.yml -i ansible_playbooks/inventory.ini --extra-vars "ansible_ssh_pass=$password ansible_ssh_common_args='-o StrictHostKeyChecking=no'"
|
||||
@@ -26,12 +26,12 @@
|
||||
|
||||
- name: Editing Caddyfile to setup the reverse_proxy
|
||||
ansible.builtin.template:
|
||||
src: ~/ansible/templates/Caddyfile.j2
|
||||
src: templates/Caddyfile.j2
|
||||
dest: /etc/caddy/Caddyfile
|
||||
|
||||
- name: Put the service binary on the remote server
|
||||
ansible.builtin.copy:
|
||||
src: ~/ansible/files/usertwist
|
||||
src: files/usertwist
|
||||
dest: /usr/local/bin
|
||||
owner: root
|
||||
group: root
|
||||
@@ -39,7 +39,7 @@
|
||||
|
||||
- name: Put the service systemd file on the remote server
|
||||
ansible.builtin.copy:
|
||||
src: ~/ansible/files/usertwist.service
|
||||
src: files/usertwist.service
|
||||
dest: /etc/systemd/system
|
||||
owner: root
|
||||
group: root
|
||||
|
||||
@@ -9,19 +9,19 @@
|
||||
|
||||
- name: Get SSH Private Key
|
||||
ansible.builtin.fetch:
|
||||
dest: "~/ansible/keys/"
|
||||
dest: "keys/"
|
||||
src: "~/ssh_key"
|
||||
flat: true
|
||||
|
||||
- name: Get SSH Public Key
|
||||
ansible.builtin.fetch:
|
||||
dest: "~/ansible/keys/"
|
||||
dest: "keys/"
|
||||
src: "~/ssh_key.pub"
|
||||
flat: true
|
||||
|
||||
- name: Copy new SSH configuration
|
||||
ansible.builtin.template:
|
||||
src: "~/ansible/templates/sshd_config.j2"
|
||||
src: "templates/sshd_config.j2"
|
||||
dest: "/etc/ssh/sshd_config"
|
||||
|
||||
- name: Create new user
|
||||
@@ -40,7 +40,7 @@
|
||||
- name: Add SSH public key to remote host
|
||||
ansible.builtin.authorized_key:
|
||||
user: "motysten"
|
||||
key: "{{ lookup('file', '~/ansible/keys/ssh_key.pub') }}"
|
||||
key: "{{ lookup('file', 'keys/ssh_key.pub') }}"
|
||||
become: true
|
||||
|
||||
- name: Restart SSH Services
|
||||
|
||||
Reference in New Issue
Block a user