switching to apt install of install script
This commit is contained in:
+33
-21
@@ -1,33 +1,45 @@
|
|||||||
---
|
---
|
||||||
- hosts: debianhosts
|
- hosts: debianhosts
|
||||||
|
gather_facts: no
|
||||||
tasks:
|
tasks:
|
||||||
- name: change working directory
|
- name: change working directory
|
||||||
ansible.builtin.shell:
|
ansible.builtin.shell:
|
||||||
cmd: ls -l
|
cmd: ls -l
|
||||||
chdir: /tmp
|
chdir: /tmp
|
||||||
|
|
||||||
- name: Get beszel agent install script
|
- name: Install a list of packages
|
||||||
become: yes
|
ansible.builtin.apt:
|
||||||
get_url:
|
pkg:
|
||||||
url: https://get.beszel.dev
|
- apt-transport-https
|
||||||
dest: /tmp/install-agent.sh
|
- curl
|
||||||
|
- gnupg
|
||||||
|
|
||||||
- name: Change file ownership, group and permissions
|
- name: Add key
|
||||||
ansible.builtin.file:
|
|
||||||
path: /tmp/install-agent.sh
|
|
||||||
# owner: root
|
|
||||||
# group: root
|
|
||||||
mode: '0755'
|
|
||||||
|
|
||||||
- name: Execute beszel agent install script
|
|
||||||
ansible.builtin.shell:
|
ansible.builtin.shell:
|
||||||
cmd: /tmp/install-agent.sh -p 45876 -k "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEhA2xm3yiEqzi5dn8UerbbhZTkU538O1g1KF2d7LefT" #stopping here as this command requires input.
|
cmd: curl -fsSL https://bazel.build/bazel-release.pub.gpg | gpg --dearmor >bazel-archive-keyring.gpg
|
||||||
|
|
||||||
- name: Add beszel agent key
|
# - name: Update all installed packages using APT module
|
||||||
ansible.builtin.shell:
|
# apt:
|
||||||
cmd: echo "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEhA2xm3yiEqzi5dn8UerbbhZTkU538O1g1KF2d7LefT" >> /root/.ssh/authorized_keys
|
# name: '*'
|
||||||
|
# state: latest
|
||||||
|
# update_cache: yes
|
||||||
|
# only_upgrade: yes
|
||||||
|
# register: apt_update_status
|
||||||
|
|
||||||
- hosts: windowshosts
|
# - name: Update all installed packages using APT module
|
||||||
tasks:
|
# apt:
|
||||||
- name: Install linux beszel agent
|
# name: '*'
|
||||||
command: Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser; & iwr -useb https://get.beszel.dev -OutFile "$env:TEMP\install-agent.ps1"; & "$env:TEMP\install-agent.ps1" -Key "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEhA2xm3yiEqzi5dn8UerbbhZTkU538O1g1KF2d7LefT" -Port 45876
|
# state: latest
|
||||||
|
# update_cache: yes
|
||||||
|
# only_upgrade: yes
|
||||||
|
# register: apt_update_status
|
||||||
|
|
||||||
|
# - name: Remove packages not needed anymore
|
||||||
|
# apt:
|
||||||
|
# autoremove: yes
|
||||||
|
|
||||||
|
# - name: Reboot when packages were updated
|
||||||
|
# reboot:
|
||||||
|
# post_reboot_delay: 60
|
||||||
|
# when: apt_update_status.changed
|
||||||
|
#
|
||||||
|
|||||||
@@ -0,0 +1,33 @@
|
|||||||
|
---
|
||||||
|
- hosts: debianhosts
|
||||||
|
tasks:
|
||||||
|
- name: change working directory
|
||||||
|
ansible.builtin.shell:
|
||||||
|
cmd: ls -l
|
||||||
|
chdir: /tmp
|
||||||
|
|
||||||
|
- name: Get beszel agent install script
|
||||||
|
become: yes
|
||||||
|
get_url:
|
||||||
|
url: https://get.beszel.dev
|
||||||
|
dest: /tmp/install-agent.sh
|
||||||
|
|
||||||
|
- name: Change file ownership, group and permissions
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: /tmp/install-agent.sh
|
||||||
|
# owner: root
|
||||||
|
# group: root
|
||||||
|
mode: '0755'
|
||||||
|
|
||||||
|
- name: Execute beszel agent install script
|
||||||
|
ansible.builtin.shell:
|
||||||
|
cmd: /tmp/install-agent.sh -p 45876 -k "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEhA2xm3yiEqzi5dn8UerbbhZTkU538O1g1KF2d7LefT" #stopping here as this command requires input.
|
||||||
|
|
||||||
|
- name: Add beszel agent key
|
||||||
|
ansible.builtin.shell:
|
||||||
|
cmd: echo "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEhA2xm3yiEqzi5dn8UerbbhZTkU538O1g1KF2d7LefT" >> /root/.ssh/authorized_keys
|
||||||
|
|
||||||
|
- hosts: windowshosts
|
||||||
|
tasks:
|
||||||
|
- name: Install linux beszel agent
|
||||||
|
command: Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser; & iwr -useb https://get.beszel.dev -OutFile "$env:TEMP\install-agent.ps1"; & "$env:TEMP\install-agent.ps1" -Key "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEhA2xm3yiEqzi5dn8UerbbhZTkU538O1g1KF2d7LefT" -Port 45876
|
||||||
@@ -20,14 +20,6 @@
|
|||||||
reboot:
|
reboot:
|
||||||
when: yum_update_status.changed
|
when: yum_update_status.changed
|
||||||
|
|
||||||
- hosts: plexhosts
|
|
||||||
gather_facts: no
|
|
||||||
tasks:
|
|
||||||
- name: This command will change the working directory to somedir/
|
|
||||||
ansible.builtin.shell: /usr/local/bin/update-plex.sh
|
|
||||||
#chdir: /usr/local/bin/
|
|
||||||
|
|
||||||
|
|
||||||
- hosts: debianhosts
|
- hosts: debianhosts
|
||||||
gather_facts: no
|
gather_facts: no
|
||||||
tasks:
|
tasks:
|
||||||
|
|||||||
Reference in New Issue
Block a user