Working on frand deployement
This commit is contained in:
@@ -1,204 +0,0 @@
|
|||||||
#################################################
|
|
||||||
# DO Community Playbooks: Docker
|
|
||||||
#################################################
|
|
||||||
---
|
|
||||||
- name: Bake pies
|
|
||||||
hosts: all
|
|
||||||
become: true
|
|
||||||
vars_files:
|
|
||||||
- vars/pies.yml
|
|
||||||
|
|
||||||
tasks:
|
|
||||||
# - name: Check if LCD Rotated
|
|
||||||
# shell: grep -c "lcd_rotate=2" /boot/config.txt || true
|
|
||||||
# register: lcd_rotate_test
|
|
||||||
|
|
||||||
# - name: rotate the lcd
|
|
||||||
# lineinfile:
|
|
||||||
# dest: /boot/config.txt
|
|
||||||
# line: lcd_rotate=2
|
|
||||||
# when: lcd_rotate_test.stdout == "0"
|
|
||||||
|
|
||||||
- name: Update the hostname file
|
|
||||||
ansible.builtin.replace:
|
|
||||||
path: /etc/hostname
|
|
||||||
regexp: "(\\s*)raspberrypi(\\s+.*)?$"
|
|
||||||
replace: "\\1{{ hostname }}\\2"
|
|
||||||
backup: true
|
|
||||||
|
|
||||||
- name: Update the hosts file
|
|
||||||
ansible.builtin.replace:
|
|
||||||
path: /etc/hosts
|
|
||||||
regexp: "(\\s+)raspberrypi(\\s+.*)?$"
|
|
||||||
replace: "\\1{{ hostname }}\\2"
|
|
||||||
backup: true
|
|
||||||
|
|
||||||
- name: Ensure SSH Directory exists
|
|
||||||
ansible.builtin.file:
|
|
||||||
path: "/home/{{ user }}/.ssh"
|
|
||||||
state: directory
|
|
||||||
group: "{{ user }}"
|
|
||||||
owner: "{{ user }}"
|
|
||||||
mode: "0700"
|
|
||||||
|
|
||||||
- name: Ensure authorized_keys file exists
|
|
||||||
ansible.builtin.copy:
|
|
||||||
content: ""
|
|
||||||
dest: "/home/{{ user }}/.ssh/authorized_keys"
|
|
||||||
force: false
|
|
||||||
group: "{{ user }}"
|
|
||||||
owner: "{{ user }}"
|
|
||||||
mode: "0644"
|
|
||||||
|
|
||||||
- name: Check Terminus public key
|
|
||||||
ansible.builtin.shell: "grep -c \"{{ terminus_key }}\" /home/{{ user }}/.ssh/authorized_keys || true"
|
|
||||||
register: terminuskey_test
|
|
||||||
changed_when: false
|
|
||||||
|
|
||||||
- name: Add Terminus public key
|
|
||||||
ansible.builtin.lineinfile:
|
|
||||||
dest: "/home/{{ user }}/.ssh/authorized_keys"
|
|
||||||
line: "{{ terminus_key }}"
|
|
||||||
when: terminuskey_test.stdout == "0"
|
|
||||||
|
|
||||||
- name: Check clair public key
|
|
||||||
ansible.builtin.shell: "grep -c \"{{ clair_key }}\" /home/{{ user }}/.ssh/authorized_keys || true"
|
|
||||||
register: clairkey_test
|
|
||||||
changed_when: false
|
|
||||||
|
|
||||||
- name: Add clair public key
|
|
||||||
ansible.builtin.lineinfile:
|
|
||||||
dest: "/home/{{ user }}/.ssh/authorized_keys"
|
|
||||||
line: "{{ clair_key }}"
|
|
||||||
when: clairkey_test.stdout == "0"
|
|
||||||
|
|
||||||
- name: Check Anjin public key
|
|
||||||
ansible.builtin.shell: "grep -c \"{{ anjin_key }}\" /home/{{ user }}/.ssh/authorized_keys || true"
|
|
||||||
register: anjin_key_test
|
|
||||||
changed_when: false
|
|
||||||
|
|
||||||
- name: Add Anjin public key
|
|
||||||
ansible.builtin.lineinfile:
|
|
||||||
dest: "/home/{{ user }}/.ssh/authorized_keys"
|
|
||||||
line: "{{ anjin_key }}"
|
|
||||||
when: anjin_key_test.stdout == "0"
|
|
||||||
|
|
||||||
- name: Update the sshd config file to disable password logins
|
|
||||||
ansible.builtin.replace:
|
|
||||||
path: /etc/ssh/sshd_config
|
|
||||||
regexp: "(\\s+)#PasswordAuthentication yes(\\s+.*)?$"
|
|
||||||
replace: "\\1PasswordAuthentication no\\2"
|
|
||||||
backup: true
|
|
||||||
|
|
||||||
- name: Check if .ssh config file exists
|
|
||||||
ansible.builtin.stat:
|
|
||||||
path: "/home/{{ user }}/.ssh/config"
|
|
||||||
register: config_status
|
|
||||||
|
|
||||||
- name: No need to upload the .ssh config
|
|
||||||
when: config_status.stat.exists
|
|
||||||
ansible.builtin.debug:
|
|
||||||
msg: No need to upload the .ssh config as it already exists.
|
|
||||||
|
|
||||||
- name: Upload the .ssh config file
|
|
||||||
when: not config_status.stat.exists
|
|
||||||
ansible.builtin.template:
|
|
||||||
src: "files/config"
|
|
||||||
dest: "/home/{{ user }}/.ssh/config"
|
|
||||||
group: "{{ user }}"
|
|
||||||
owner: "{{ user }}"
|
|
||||||
mode: "0644"
|
|
||||||
|
|
||||||
- name: Check if ed25519 key exists
|
|
||||||
ansible.builtin.stat:
|
|
||||||
path: "/home/{{ user }}/.ssh/id_ed25519"
|
|
||||||
register: key_status
|
|
||||||
|
|
||||||
- name: No need to generate new ed25519 key
|
|
||||||
when: key_status.stat.exists
|
|
||||||
ansible.builtin.debug:
|
|
||||||
msg: No need to generate new ed25519 key as it already exists.
|
|
||||||
|
|
||||||
- name: Generate new id_ed25519 key
|
|
||||||
when: not key_status.stat.exists
|
|
||||||
become: true
|
|
||||||
become_user: "{{ user }}"
|
|
||||||
ansible.builtin.shell: ssh-keygen -t ed25519 -q -f "/home/{{ user }}/.ssh/id_ed25519" -C "{{ user }}@{{ hostname }} $(date '+%Y.%m.%d')" -N ""
|
|
||||||
changed_when: true
|
|
||||||
|
|
||||||
- name: Install Docker
|
|
||||||
ansible.builtin.shell: curl -sSL https://get.docker.com | sh # noqa command-instead-of-module risky-shell-pipe
|
|
||||||
changed_when: true
|
|
||||||
|
|
||||||
- name: Install matchbox-keyboard
|
|
||||||
ansible.builtin.package:
|
|
||||||
name: matchbox-keyboard
|
|
||||||
state: present
|
|
||||||
|
|
||||||
- name: Install python3-docker
|
|
||||||
ansible.builtin.package:
|
|
||||||
name: python3-docker
|
|
||||||
state: present
|
|
||||||
|
|
||||||
- name: Adding user to group docker
|
|
||||||
ansible.builtin.user:
|
|
||||||
name: "{{ user }}"
|
|
||||||
groups: docker
|
|
||||||
append: true
|
|
||||||
|
|
||||||
- name: Adding user to group lp (line printers)
|
|
||||||
ansible.builtin.user:
|
|
||||||
name: "{{ user }}"
|
|
||||||
groups: lp
|
|
||||||
append: true
|
|
||||||
|
|
||||||
- name: Install nats-tunnel systemd unit file
|
|
||||||
ansible.builtin.template:
|
|
||||||
src: "files/nats-tunnel.service"
|
|
||||||
dest: "/etc/systemd/system/nats-tunnel.service"
|
|
||||||
mode: "0644"
|
|
||||||
|
|
||||||
- name: Enable service nats-tunnel and ensure it is not masked
|
|
||||||
ansible.builtin.systemd:
|
|
||||||
name: nats-tunnel
|
|
||||||
enabled: true
|
|
||||||
masked: false
|
|
||||||
|
|
||||||
- name: Make sure nats-tunnel service is running
|
|
||||||
ansible.builtin.systemd:
|
|
||||||
state: started
|
|
||||||
name: nats-tunnel
|
|
||||||
|
|
||||||
- name: Install leardal systemd unit file
|
|
||||||
ansible.builtin.template:
|
|
||||||
src: "files/leardal.service"
|
|
||||||
dest: "/etc/systemd/system/leardal.service"
|
|
||||||
mode: "0644"
|
|
||||||
|
|
||||||
- name: Enable service leardal and ensure it is not masked
|
|
||||||
ansible.builtin.systemd:
|
|
||||||
name: leardal
|
|
||||||
enabled: true
|
|
||||||
masked: false
|
|
||||||
|
|
||||||
- name: Make sure leardal service is running
|
|
||||||
ansible.builtin.systemd:
|
|
||||||
state: started
|
|
||||||
name: leardal
|
|
||||||
|
|
||||||
- name: Check if NetBird is installed
|
|
||||||
ansible.builtin.command: netbird --version
|
|
||||||
register: netbird_installed
|
|
||||||
ignore_errors: true
|
|
||||||
changed_when: false
|
|
||||||
|
|
||||||
- name: Install NetBird client
|
|
||||||
ansible.builtin.shell: curl -fsSL https://pkgs.netbird.io/install.sh | sh
|
|
||||||
when: netbird_installed.rc != 0
|
|
||||||
changed_when: true
|
|
||||||
|
|
||||||
- name: Connect NetBird to management server
|
|
||||||
ansible.builtin.command: >
|
|
||||||
netbird up --management-url {{ netbird_management_url }} --setup-key {{ netbird_setup_key }}
|
|
||||||
when: netbird_installed.rc != 0
|
|
||||||
changed_when: true
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
[Unit]
|
|
||||||
Description=Reverse SSH connection
|
|
||||||
After=network.target
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
Type=simple
|
|
||||||
User={{ user }}
|
|
||||||
|
|
||||||
ExecStart=/usr/bin/ssh -NTg -o ServerAliveInterval=60 -o ExitOnForwardFailure=yes -o ServerAliveCountMax=3 -o StrictHostKeyChecking=no -i /home/{{ user }}/.ssh/id_ed25519 -R {{ ssh_port }}:localhost:22 tanshu@{{ server }}.tanshu.com
|
|
||||||
|
|
||||||
# Restart every >2 seconds to avoid StartLimitInterval failure
|
|
||||||
Restart=always
|
|
||||||
RestartSec=5s
|
|
||||||
|
|
||||||
[Install]
|
|
||||||
WantedBy=default.target
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
[Unit]
|
|
||||||
Description=Keep ssh tunnel to specified remote host open
|
|
||||||
After=network.target
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
User={{ user }}
|
|
||||||
|
|
||||||
ExecStart=/usr/bin/ssh -NT -o ServerAliveInterval=30 -o ExitOnForwardFailure=yes -o ServerAliveCountMax=2 -o StrictHostKeyChecking=no -i /home/{{ user }}/.ssh/id_ed25519 -L 4222:localhost:4222 tanshu@{{ server }}.tanshu.com
|
|
||||||
|
|
||||||
# Restart every >2 seconds to avoid StartLimitInterval failure
|
|
||||||
RestartSec=5
|
|
||||||
Restart=always
|
|
||||||
|
|
||||||
[Install]
|
|
||||||
WantedBy=multi-user.target
|
|
||||||
@@ -16,5 +16,4 @@
|
|||||||
when: var_file is defined
|
when: var_file is defined
|
||||||
|
|
||||||
roles:
|
roles:
|
||||||
- tunnels
|
|
||||||
- frank
|
- frank
|
||||||
+14
-13
@@ -2,16 +2,17 @@
|
|||||||
ansible_python_interpreter=/usr/bin/python3
|
ansible_python_interpreter=/usr/bin/python3
|
||||||
|
|
||||||
[frank]
|
[frank]
|
||||||
chd-bar ansible_host=clair var_file=vars/devices/chd-bar.yml
|
chd-bar ansible_host="clair" var_file=vars/devices/chd-bar.yml
|
||||||
pkl1 ansible_host=clair var_file=vars/devices/pkl1.yml
|
pkl1 ansible_host="clair" var_file=vars/devices/pkl1.yml
|
||||||
pkl2 ansible_host=clair var_file=vars/devices/pkl2.yml
|
pkl2 ansible_host="clair" var_file=vars/devices/pkl2.yml
|
||||||
pkl3 ansible_host=clair var_file=vars/devices/pkl3.yml
|
pkl3 ansible_host="clair" var_file=vars/devices/pkl3.yml
|
||||||
pkl4 ansible_host=clair var_file=vars/devices/pkl4.yml
|
pkl4 ansible_host="clair" var_file=vars/devices/pkl4.yml
|
||||||
moz1 ansible_host=clair var_file=vars/devices/moz1.yml
|
moz1 ansible_host="clair" var_file=vars/devices/moz1.yml
|
||||||
moz2 ansible_host=clair var_file=vars/devices/moz2.yml
|
moz2 ansible_host="clair" var_file=vars/devices/moz2.yml
|
||||||
mhl1 ansible_host=clair var_file=vars/devices/mhl1.yml
|
mhl1 ansible_host="clair" var_file=vars/devices/mhl1.yml
|
||||||
mhl2 ansible_host=clair var_file=vars/devices/mhl2.yml
|
mhl2 ansible_host="clair" var_file=vars/devices/mhl2.yml
|
||||||
mhl3 ansible_host=clair var_file=vars/devices/mhl3.yml
|
mhl3 ansible_host="clair" var_file=vars/devices/mhl3.yml
|
||||||
mhl4 ansible_host=clair var_file=vars/devices/mhl4.yml
|
mhl4 ansible_host="clair" var_file=vars/devices/mhl4.yml
|
||||||
chd1 ansible_host=clair var_file=vars/devices/chd1.yml
|
chd1 ansible_host="clair" var_file=vars/devices/chd1.yml
|
||||||
chd2 ansible_host=clair var_file=vars/devices/chd2.yml
|
chd2 ansible_host="clair" var_file=vars/devices/chd2.yml
|
||||||
|
tan-home ansible-host="tan-home" var_file=vars/devices/tan-home.yml
|
||||||
|
|||||||
Executable
+21
@@ -0,0 +1,21 @@
|
|||||||
|
#################################################
|
||||||
|
# DO Community Playbooks: Docker
|
||||||
|
#################################################
|
||||||
|
---
|
||||||
|
- name: Bake pies
|
||||||
|
hosts: all
|
||||||
|
become: true
|
||||||
|
vars_files:
|
||||||
|
- vars/pies.yml
|
||||||
|
|
||||||
|
pre_tasks:
|
||||||
|
- name: Load per-host vars file from inventory (var_file)
|
||||||
|
ansible.builtin.include_vars:
|
||||||
|
file: "{{ var_file }}"
|
||||||
|
when: var_file is defined
|
||||||
|
|
||||||
|
roles:
|
||||||
|
- common
|
||||||
|
- zsh
|
||||||
|
- docker
|
||||||
|
- netbird_client
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
Host {{ server }} {{ server }}.tanshu.com
|
||||||
|
HostName {{ server }}.tanshu.com
|
||||||
|
IdentityFile ~/.ssh/id_ed25519
|
||||||
|
User tanshu
|
||||||
@@ -0,0 +1,99 @@
|
|||||||
|
---
|
||||||
|
- name: Ensure SSH Directory exists
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: "/home/{{ user }}/.ssh"
|
||||||
|
state: directory
|
||||||
|
group: "{{ user }}"
|
||||||
|
owner: "{{ user }}"
|
||||||
|
mode: "0700"
|
||||||
|
|
||||||
|
- name: Ensure authorized_keys file exists
|
||||||
|
ansible.builtin.copy:
|
||||||
|
content: ""
|
||||||
|
dest: "/home/{{ user }}/.ssh/authorized_keys"
|
||||||
|
force: false
|
||||||
|
group: "{{ user }}"
|
||||||
|
owner: "{{ user }}"
|
||||||
|
mode: "0644"
|
||||||
|
|
||||||
|
- name: Check Terminus public key
|
||||||
|
ansible.builtin.shell: "grep -c \"{{ terminus_key }}\" /home/{{ user }}/.ssh/authorized_keys || true"
|
||||||
|
register: terminuskey_test
|
||||||
|
changed_when: false
|
||||||
|
|
||||||
|
- name: Add Terminus public key
|
||||||
|
ansible.builtin.lineinfile:
|
||||||
|
dest: "/home/{{ user }}/.ssh/authorized_keys"
|
||||||
|
line: "{{ terminus_key }}"
|
||||||
|
when: terminuskey_test.stdout == "0"
|
||||||
|
|
||||||
|
- name: Check clair public key
|
||||||
|
ansible.builtin.shell: "grep -c \"{{ clair_key }}\" /home/{{ user }}/.ssh/authorized_keys || true"
|
||||||
|
register: clairkey_test
|
||||||
|
changed_when: false
|
||||||
|
|
||||||
|
- name: Add clair public key
|
||||||
|
ansible.builtin.lineinfile:
|
||||||
|
dest: "/home/{{ user }}/.ssh/authorized_keys"
|
||||||
|
line: "{{ clair_key }}"
|
||||||
|
when: clairkey_test.stdout == "0"
|
||||||
|
|
||||||
|
- name: Check Anjin public key
|
||||||
|
ansible.builtin.shell: "grep -c \"{{ anjin_key }}\" /home/{{ user }}/.ssh/authorized_keys || true"
|
||||||
|
register: anjin_key_test
|
||||||
|
changed_when: false
|
||||||
|
|
||||||
|
- name: Add Anjin public key
|
||||||
|
ansible.builtin.lineinfile:
|
||||||
|
dest: "/home/{{ user }}/.ssh/authorized_keys"
|
||||||
|
line: "{{ anjin_key }}"
|
||||||
|
when: anjin_key_test.stdout == "0"
|
||||||
|
|
||||||
|
- name: Update the sshd config file to disable password logins
|
||||||
|
ansible.builtin.replace:
|
||||||
|
path: /etc/ssh/sshd_config
|
||||||
|
regexp: "(\\s+)#PasswordAuthentication yes(\\s+.*)?$"
|
||||||
|
replace: "\\1PasswordAuthentication no\\2"
|
||||||
|
backup: true
|
||||||
|
|
||||||
|
- name: Check if .ssh config file exists
|
||||||
|
ansible.builtin.stat:
|
||||||
|
path: "/home/{{ user }}/.ssh/config"
|
||||||
|
register: config_status
|
||||||
|
|
||||||
|
- name: No need to upload the .ssh config
|
||||||
|
when: config_status.stat.exists
|
||||||
|
ansible.builtin.debug:
|
||||||
|
msg: No need to upload the .ssh config as it already exists.
|
||||||
|
|
||||||
|
- name: Upload the .ssh config file
|
||||||
|
when: not config_status.stat.exists
|
||||||
|
ansible.builtin.template:
|
||||||
|
src: "files/config"
|
||||||
|
dest: "/home/{{ user }}/.ssh/config"
|
||||||
|
group: "{{ user }}"
|
||||||
|
owner: "{{ user }}"
|
||||||
|
mode: "0644"
|
||||||
|
|
||||||
|
- name: Check if ed25519 key exists
|
||||||
|
ansible.builtin.stat:
|
||||||
|
path: "/home/{{ user }}/.ssh/id_ed25519"
|
||||||
|
register: key_status
|
||||||
|
|
||||||
|
- name: No need to generate new ed25519 key
|
||||||
|
when: key_status.stat.exists
|
||||||
|
ansible.builtin.debug:
|
||||||
|
msg: No need to generate new ed25519 key as it already exists.
|
||||||
|
|
||||||
|
- name: Generate new id_ed25519 key
|
||||||
|
when: not key_status.stat.exists
|
||||||
|
become: true
|
||||||
|
become_user: "{{ user }}"
|
||||||
|
ansible.builtin.shell: ssh-keygen -t ed25519 -q -f "/home/{{ user }}/.ssh/id_ed25519" -C "{{ user }}@{{ hostname }} $(date '+%Y.%m.%d')" -N ""
|
||||||
|
changed_when: true
|
||||||
|
|
||||||
|
- name: Adding user to group lp (line printers)
|
||||||
|
ansible.builtin.user:
|
||||||
|
name: "{{ user }}"
|
||||||
|
groups: lp
|
||||||
|
append: true
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
---
|
||||||
|
- name: Check if Docker is installed
|
||||||
|
ansible.builtin.command: docker --version
|
||||||
|
register: docker_installed
|
||||||
|
ignore_errors: true
|
||||||
|
changed_when: false
|
||||||
|
|
||||||
|
- name: Install Docker
|
||||||
|
ansible.builtin.shell: curl -sSL https://get.docker.com | sh # noqa command-instead-of-module risky-shell-pipe
|
||||||
|
when: docker_installed.rc != 0
|
||||||
|
changed_when: true
|
||||||
|
|
||||||
|
- name: Install python3-docker
|
||||||
|
ansible.builtin.package:
|
||||||
|
name: python3-docker
|
||||||
|
state: present
|
||||||
|
|
||||||
|
- name: Adding user to group docker
|
||||||
|
ansible.builtin.user:
|
||||||
|
name: "{{ user }}"
|
||||||
|
groups: docker
|
||||||
|
append: true
|
||||||
@@ -32,7 +32,6 @@
|
|||||||
community.docker.docker_container:
|
community.docker.docker_container:
|
||||||
name: "frank"
|
name: "frank"
|
||||||
image: "registry.tanshu.com/frank:{{ frank_version | default('latest') }}"
|
image: "registry.tanshu.com/frank:{{ frank_version | default('latest') }}"
|
||||||
pull: true
|
|
||||||
state: started
|
state: started
|
||||||
restart_policy: "no"
|
restart_policy: "no"
|
||||||
env_file: "/home/{{ user }}/frank.env"
|
env_file: "/home/{{ user }}/frank.env"
|
||||||
@@ -56,20 +55,3 @@
|
|||||||
systemd:
|
systemd:
|
||||||
state: started
|
state: started
|
||||||
name: frank
|
name: frank
|
||||||
|
|
||||||
- name: Check if NetBird is installed
|
|
||||||
ansible.builtin.command: netbird --version
|
|
||||||
register: netbird_installed
|
|
||||||
ignore_errors: true
|
|
||||||
changed_when: false
|
|
||||||
|
|
||||||
- name: Install NetBird client
|
|
||||||
ansible.builtin.shell: curl -fsSL https://pkgs.netbird.io/install.sh | sh
|
|
||||||
when: netbird_installed.rc != 0
|
|
||||||
changed_when: true
|
|
||||||
|
|
||||||
- name: Connect NetBird to management server
|
|
||||||
ansible.builtin.command: >
|
|
||||||
netbird up --management-url {{ netbird_management_url }} --setup-key {{ netbird_setup_key }}
|
|
||||||
when: netbird_installed.rc != 0
|
|
||||||
changed_when: true
|
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
---
|
||||||
|
- name: Check if NetBird is installed
|
||||||
|
ansible.builtin.command: netbird version
|
||||||
|
register: netbird_installed
|
||||||
|
ignore_errors: true
|
||||||
|
changed_when: false
|
||||||
|
|
||||||
|
- name: Install NetBird client
|
||||||
|
ansible.builtin.shell: curl -fsSL https://pkgs.netbird.io/install.sh | sh
|
||||||
|
when: netbird_installed.rc != 0
|
||||||
|
changed_when: true
|
||||||
|
|
||||||
|
- name: Connect NetBird to management server
|
||||||
|
ansible.builtin.command: >
|
||||||
|
netbird up --management-url {{ netbird_management_url }} --setup-key {{ netbird_setup_key }}
|
||||||
|
when: netbird_installed.rc != 0
|
||||||
|
changed_when: true
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
---
|
|
||||||
- name: Install nats-tunnel systemd unit file
|
|
||||||
ansible.builtin.template:
|
|
||||||
src: "files/nats-tunnel.service"
|
|
||||||
dest: "/etc/systemd/system/nats-tunnel.service"
|
|
||||||
mode: "0644"
|
|
||||||
|
|
||||||
- name: Enable service nats-tunnel and ensure it is not masked
|
|
||||||
ansible.builtin.systemd:
|
|
||||||
name: nats-tunnel
|
|
||||||
enabled: true
|
|
||||||
masked: false
|
|
||||||
|
|
||||||
- name: Make sure nats-tunnel service is running
|
|
||||||
ansible.builtin.systemd:
|
|
||||||
state: started
|
|
||||||
name: nats-tunnel
|
|
||||||
|
|
||||||
- name: Install leardal systemd unit file
|
|
||||||
ansible.builtin.template:
|
|
||||||
src: "files/leardal.service"
|
|
||||||
dest: "/etc/systemd/system/leardal.service"
|
|
||||||
mode: "0644"
|
|
||||||
|
|
||||||
- name: Enable service leardal and ensure it is not masked
|
|
||||||
ansible.builtin.systemd:
|
|
||||||
name: leardal
|
|
||||||
enabled: true
|
|
||||||
masked: false
|
|
||||||
|
|
||||||
- name: Make sure leardal service is running
|
|
||||||
ansible.builtin.systemd:
|
|
||||||
state: started
|
|
||||||
name: leardal
|
|
||||||
@@ -0,0 +1,76 @@
|
|||||||
|
---
|
||||||
|
- name: Install ZSH and required packages
|
||||||
|
ansible.builtin.package:
|
||||||
|
name:
|
||||||
|
- zsh
|
||||||
|
- tmux
|
||||||
|
- powerline
|
||||||
|
- git
|
||||||
|
- git-gui
|
||||||
|
state: present
|
||||||
|
update_cache: true
|
||||||
|
|
||||||
|
- name: Change default shell to ZSH
|
||||||
|
ansible.builtin.user:
|
||||||
|
name: "{{ user }}"
|
||||||
|
shell: /bin/zsh
|
||||||
|
|
||||||
|
- name: Check if oh-my-zsh is already installed
|
||||||
|
ansible.builtin.stat:
|
||||||
|
path: "/home/{{ user }}/.oh-my-zsh"
|
||||||
|
register: oh_my_zsh_stat
|
||||||
|
|
||||||
|
- name: Install oh-my-zsh
|
||||||
|
ansible.builtin.git:
|
||||||
|
repo: https://github.com/robbyrussell/oh-my-zsh.git
|
||||||
|
dest: "/home/{{ user }}/.oh-my-zsh"
|
||||||
|
depth: 1
|
||||||
|
when: not oh_my_zsh_stat.stat.exists
|
||||||
|
become: true
|
||||||
|
become_user: "{{ user }}"
|
||||||
|
|
||||||
|
- name: Install zsh-autosuggestions plugin
|
||||||
|
ansible.builtin.git:
|
||||||
|
repo: https://github.com/zsh-users/zsh-autosuggestions
|
||||||
|
dest: "/home/{{ user }}/.oh-my-zsh/custom/plugins/zsh-autosuggestions"
|
||||||
|
depth: 1
|
||||||
|
become: true
|
||||||
|
become_user: "{{ user }}"
|
||||||
|
|
||||||
|
- name: Install zsh-syntax-highlighting plugin
|
||||||
|
ansible.builtin.git:
|
||||||
|
repo: https://github.com/zsh-users/zsh-syntax-highlighting.git
|
||||||
|
dest: "/home/{{ user }}/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting"
|
||||||
|
depth: 1
|
||||||
|
become: true
|
||||||
|
become_user: "{{ user }}"
|
||||||
|
|
||||||
|
- name: Ensure .zshrc exists (copy template if needed)
|
||||||
|
ansible.builtin.copy:
|
||||||
|
src: "/home/{{ user }}/.oh-my-zsh/templates/zshrc.zsh-template"
|
||||||
|
dest: "/home/{{ user }}/.zshrc"
|
||||||
|
remote_src: true
|
||||||
|
force: false
|
||||||
|
owner: "{{ user }}"
|
||||||
|
group: "{{ user }}"
|
||||||
|
mode: "0644"
|
||||||
|
|
||||||
|
- name: Set ZSH theme to agnoster
|
||||||
|
ansible.builtin.replace:
|
||||||
|
path: "/home/{{ user }}/.zshrc"
|
||||||
|
regexp: 'ZSH_THEME="robbyrussell"'
|
||||||
|
replace: 'ZSH_THEME="agnoster"'
|
||||||
|
|
||||||
|
- name: Enable ZSH plugins
|
||||||
|
ansible.builtin.replace:
|
||||||
|
path: "/home/{{ user }}/.zshrc"
|
||||||
|
regexp: 'plugins=\(git\)'
|
||||||
|
replace: 'plugins=(git zsh-autosuggestions zsh-syntax-highlighting)'
|
||||||
|
|
||||||
|
- name: Add custom aliases to .zshrc
|
||||||
|
ansible.builtin.lineinfile:
|
||||||
|
path: "/home/{{ user }}/.zshrc"
|
||||||
|
line: "alias ls='ls --color=auto --indicator-style=slash --human-readable --format=long'"
|
||||||
|
create: true
|
||||||
|
owner: "{{ user }}"
|
||||||
|
group: "{{ user }}"
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
hostname: tan-home
|
||||||
|
user: barker
|
||||||
|
queue_name: tan-home
|
||||||
|
printer_port: "/dev/usb/lp0"
|
||||||
@@ -4,4 +4,4 @@ clair_key: "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBeTz3weHvjJRTlBg+ovP3KfQNDvyn9m
|
|||||||
anjin_key: "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMlvalE0JqKyjpEsGTgtf/N1d9QK2MgNFJib+e8O2h9M tanshu@anjin 2024.09.28"
|
anjin_key: "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMlvalE0JqKyjpEsGTgtf/N1d9QK2MgNFJib+e8O2h9M tanshu@anjin 2024.09.28"
|
||||||
server: "clair"
|
server: "clair"
|
||||||
netbird_management_url: "https://netbird.tanshu.com"
|
netbird_management_url: "https://netbird.tanshu.com"
|
||||||
netbird_setup_key: "REPLACE_ME_WITH_SETUP_KEY"
|
netbird_setup_key: "3B166E0E-5D6C-494B-B385-F7A8FE04C594"
|
||||||
|
|||||||
Generated
+1
-1
@@ -113,7 +113,7 @@ wheels = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "frank"
|
name = "frank"
|
||||||
version = "14.5.1"
|
version = "2.0.0"
|
||||||
source = { virtual = "." }
|
source = { virtual = "." }
|
||||||
dependencies = [
|
dependencies = [
|
||||||
{ name = "aiohttp" },
|
{ name = "aiohttp" },
|
||||||
|
|||||||
@@ -36,12 +36,8 @@ then
|
|||||||
echo "Version bump from $current_version to $new_version"
|
echo "Version bump from $current_version to $new_version"
|
||||||
sed --in-place --regexp-extended 's/version = "([0-9]{1,2}.[0-9]+.[0-9]+)"/version = "'"$new_version"'"/g' pyproject.toml
|
sed --in-place --regexp-extended 's/version = "([0-9]{1,2}.[0-9]+.[0-9]+)"/version = "'"$new_version"'"/g' pyproject.toml
|
||||||
git add pyproject.toml
|
git add pyproject.toml
|
||||||
git commit -m "Version Bump v$new_version (frank)"
|
|
||||||
git tag "frank-v$new_version"
|
|
||||||
else
|
else
|
||||||
echo "No version bump"
|
echo "No version bump"
|
||||||
echo "Usage: $0 <major|minor|patch|version_string>"
|
echo "Usage: $0 <major|minor|patch|version_string>"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
git push
|
|
||||||
git push --tags
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ server:
|
|||||||
auth:
|
auth:
|
||||||
issuer: "https://{{ netbird_domain }}/oauth2"
|
issuer: "https://{{ netbird_domain }}/oauth2"
|
||||||
signKeyRefreshEnabled: true
|
signKeyRefreshEnabled: true
|
||||||
sessionCookieEncryptionKey: "{{ lookup('password', '/dev/null chars=ascii_letters,digits length=32') | b64encode }}"
|
sessionCookieEncryptionKey: "{{ netbird_cookie_encryption_key }}"
|
||||||
dashboardRedirectURIs:
|
dashboardRedirectURIs:
|
||||||
- "https://{{ netbird_domain }}/nb-auth"
|
- "https://{{ netbird_domain }}/nb-auth"
|
||||||
- "https://{{ netbird_domain }}/nb-silent-auth"
|
- "https://{{ netbird_domain }}/nb-silent-auth"
|
||||||
|
|||||||
Reference in New Issue
Block a user