created new adhoc script for updating root authorized_keys file

added pbs to ansible inventory
This commit is contained in:
Radar231 2024-04-18 22:39:43 -04:00
parent c8fd01f0a8
commit 84a63a552a
7 changed files with 167 additions and 10 deletions

View File

@ -2,6 +2,6 @@
curdate=$(date +%Y%m%d)
ansible all -i inventory/prod.yml -u root -m shell -a "cat /usr/local/log/borg*${curdate}*.log" | less
ansible local -i inventory/prod.yml -u root -m shell -a "cat /usr/local/log/borg*${curdate}*.log" | less

View File

@ -0,0 +1,10 @@
#!/bin/bash
# this script allows to update the /root/.ssh/authorized_keys file on target host,
# based on the contents of http://delinit.lan/ssh-keys
#
# it expects the host pattern to be supplied on the command line
ansible $1 -i inventory/prod.yml -u root -m copy -a "src=/root/.ssh/authorized_keys dest=/root/.ssh/authorized_keys-bu remote_src=true"
ansible $1 -i inventory/prod.yml -u root -m ansible.posix.authorized_key -a "user=root key=http://delinit.lan/ssh-keys"

View File

@ -0,0 +1,49 @@
---
#######################################
# Host inventory definition
# borg1
#######################################
# host network configuration
ansible_host: 192.168.20.37
ip_gw: 192.168.20.1
ip_ns1: 192.168.20.21
ip_ns2: 192.168.20.22
#######################################
# VM/Container LXD configuration
# LXD Container or VM
host_type: Container
# LXD profile to apply
profile: bridged
# LXD image selection
image_name: "debian"
image_vers: "12"
image_location: "images"
# where to deploy container
remote_name: starbug
#######################################
# Host virtual hardware configuration
# CPU cores, Memory, Root disk size
cpu: 2
mem: 4
root: 50
#######################################
# Ansible roles to apply to host
# - uncomment to select
# - create_user includes create_user, sudoers, vim_setup, bash_mods and gitconfig roles
# - use "nil" for no ansible configuration management
host_config:
# - nil
- base_pkgs
- create_user
# - du_backups
# - monitorix
- nagios_agent
# - docker
# - k3s
#######################################
# user definition for "create_user" role
user: rmorrow
pw: resetthispasswd
home: /home/rmorrow
# EOF

View File

@ -0,0 +1,49 @@
---
#######################################
# Host inventory definition
# borg2
#######################################
# host network configuration
ansible_host: 192.168.20.28
ip_gw: 192.168.20.1
ip_ns1: 192.168.20.21
ip_ns2: 192.168.20.22
#######################################
# VM/Container LXD configuration
# LXD Container or VM
host_type: Container
# LXD profile to apply
profile: bridged
# LXD image selection
image_name: "debian"
image_vers: "12"
image_location: "images"
# where to deploy container
remote_name: starbug
#######################################
# Host virtual hardware configuration
# CPU cores, Memory, Root disk size
cpu: 2
mem: 4
root: 50
#######################################
# Ansible roles to apply to host
# - uncomment to select
# - create_user includes create_user, sudoers, vim_setup, bash_mods and gitconfig roles
# - use "nil" for no ansible configuration management
host_config:
# - nil
- base_pkgs
- create_user
# - du_backups
# - monitorix
- nagios_agent
# - docker
# - k3s
#######################################
# user definition for "create_user" role
user: rmorrow
pw: resetthispasswd
home: /home/rmorrow
# EOF

View File

@ -11,7 +11,7 @@ ip_ns2: 192.168.20.22
#######################################
# VM/Container LXD configuration
# LXD Container or VM
host_type: Container
host_type: VM
# LXD profile to apply
profile: bridged
# LXD image selection
@ -25,7 +25,7 @@ remote_name: reddwarf
# CPU cores, Memory, Root disk size
cpu: 2
mem: 4
root: 50
root: 150
#######################################
# Ansible roles to apply to host
# - uncomment to select
@ -37,7 +37,7 @@ host_config:
- create_user
# - du_backups
# - monitorix
# - nagios_agent
- nagios_agent
# - docker
# - k3s
#######################################

View File

@ -0,0 +1,49 @@
---
#######################################
# Host inventory definition
# pbs
#######################################
# host network configuration
ansible_host: 192.168.20.14
ip_gw: 192.168.20.1
ip_ns1: 192.168.20.21
ip_ns2: 192.168.20.22
#######################################
# VM/Container LXD configuration
# LXD Container or VM
host_type: VM
# LXD profile to apply
profile: n/a
# LXD image selection
image_name: "debian"
image_vers: "12"
image_location: n/a
# where to deploy container
remote_name: n/a
#######################################
# Host virtual hardware configuration
# CPU cores, Memory, Root disk size
cpu: 2
mem: 4
root: 50
#######################################
# Ansible roles to apply to host
# - uncomment to select
# - create_user includes create_user, sudoers, vim_setup, bash_mods and gitconfig roles
# - use "nil" for no ansible configuration management
host_config:
# - nil
- base_pkgs
# - create_user
# - du_backups
# - monitorix
- nagios_agent
# - docker
# - k3s
#######################################
# user definition for "create_user" role
user: rmorrow
pw: resetthispasswd
home: /home/rmorrow
# EOF

View File

@ -21,6 +21,7 @@ all:
lister:
# svrs
hudzen:
pbs:
reddwarf:
rimmer:
skutter01:
@ -38,14 +39,13 @@ all:
jellyfin:
lms:
# ctrs
borg:
borg1:
borg2:
cftrust:
delans:
deldev:
frigate:
haproxy:
metrics:
nextcloud:
npm:
ntopng:
# octoprint:
@ -72,6 +72,7 @@ all:
servers:
hosts:
hudzen:
pbs:
reddwarf:
rimmer:
skutter01:
@ -98,14 +99,13 @@ all:
#############################################
ctrs:
hosts:
borg:
borg1:
borg2:
cftrust:
delans:
deldev:
frigate:
haproxy:
metrics:
nextcloud:
npm:
ntopng:
# octoprint: