Add Music Studio, Migrate from GitHub to Personal Gitea (#1)
Reviewed-on: #1
This commit is contained in:
@ -26,7 +26,9 @@
|
||||
blockinfile:
|
||||
path: "{{ gen_file }}"
|
||||
block: |
|
||||
;;;;;;; Available options - all require lowercase values ;;;;;;
|
||||
; Please note that all potions require lowercase keys and values.
|
||||
;
|
||||
;;;;;;;;;;;;;;;;;;;; Basic Options ;;;;;;;;;;;;;;;;;;;;
|
||||
;
|
||||
; enable : Provide true for the provision to occur.
|
||||
; Default: false
|
||||
@ -39,22 +41,40 @@
|
||||
; Example: Thomas, Jerry, Kimberly, Sarah
|
||||
; Default: Hyperling
|
||||
;
|
||||
; branch : Provide the Github branch that the machine should poll.
|
||||
; Example: main, dev
|
||||
; Default: main
|
||||
; sshd_port : Determine the port which SSHD should listen on.
|
||||
; Example: 12345
|
||||
; Default: 22
|
||||
;
|
||||
; pentesting : Set to true to install tools such as metasploit.
|
||||
; nmap is already provided for reporting
|
||||
; Default: false
|
||||
;
|
||||
; no_telem : Set to true to avoid setting up telemetry services.
|
||||
; Disables GitHub updates to this project.
|
||||
; Disables all telegraf pings.
|
||||
; Default: false
|
||||
;;;;;;;;;;;;;;;;;;;; Git Polling ;;;;;;;;;;;;;;;;;;;;
|
||||
;
|
||||
; battery : Set to true to attempt to save battery life.
|
||||
; Slows down the rate of services such as telegraf and cron.
|
||||
; Default: false
|
||||
; For syncing this machine to a Git repository of this Ansible project
|
||||
; in this fashion: ssh://git@GIT_HOST:GIT_SSH_PORT/GIT_USER/GIT_PROJECT
|
||||
;
|
||||
; branch : Branch to use on this machine.
|
||||
; Example: main, dev, prod
|
||||
; Default: main
|
||||
;
|
||||
; git_host : Provide the git host that the machine should poll.
|
||||
; Example: github.com, gitlab.com. gitea.com
|
||||
; Default: git.hyperling.com
|
||||
;
|
||||
; git_ssh_port : Port of the server host to use for SSH requests.
|
||||
; Example: 22, 222, 2222
|
||||
; Default: 22
|
||||
;
|
||||
; git_user : Provide the git user which projects are found under.
|
||||
; Example: Hyperling, JimBobMcGeeJr
|
||||
; Default: me
|
||||
;
|
||||
; git_project : Name of this project on the server host.
|
||||
; Example: Ansible, ansible-setup, my-env
|
||||
; Default: env-ansible
|
||||
;
|
||||
;;;;;;;;;;;;;;;;;;;; Swap File ;;;;;;;;;;;;;;;;;;;;
|
||||
;
|
||||
; swap_block : Set to the block size if dd should create a swapfile.
|
||||
; Preferably keep this under 2G for integrity sakes, the
|
||||
@ -70,9 +90,16 @@
|
||||
; Example: /usr/local/swap
|
||||
; Default: /swapfile
|
||||
;
|
||||
; sshd_port : Determine the port which SSHD should listen on.
|
||||
; Example: 12345
|
||||
; Default: 22
|
||||
;;;;;;;;;;;;;;;;;;;; Sync Frequency ;;;;;;;;;;;;;;;;;;;;
|
||||
;
|
||||
; no_telem : Set to true to avoid setting up telemetry services.
|
||||
; Disables GitHub updates to this project.
|
||||
; Disables all telegraf pings.
|
||||
; Default: false
|
||||
;
|
||||
; battery : Set to true to attempt to save battery life.
|
||||
; Slows down the rate of services such as telegraf and cron.
|
||||
; Default: false
|
||||
;
|
||||
[global]
|
||||
marker: '; {mark} MANAGED BY ANSIBLE | Generic Config'
|
||||
@ -93,6 +120,10 @@
|
||||
swap_count: "{{ lookup('ini', 'swap_count file={{gen_file}} default=1') }}"
|
||||
swap_file: "{{ lookup('ini', 'swap_file file={{gen_file}} default=/swapfile') }}"
|
||||
sshd_port: "{{ lookup('ini', 'sshd_port file={{gen_file}} default=22') }}"
|
||||
git_host: "{{ lookup('ini', 'git_host file={{gen_file}} default=git.hyperling.com') }}"
|
||||
git_user: "{{ lookup('ini', 'git_user file={{gen_file}} default=me') }}"
|
||||
git_project: "{{ lookup('ini', 'git_project file={{gen_file}} default=env-ansible') }}"
|
||||
git_ssh_port: "{{ lookup('ini', 'git_ssh_port file={{gen_file}} default=22') }}"
|
||||
|
||||
- name: General | Account Management | Provisioning Configuration | General | List
|
||||
set_fact:
|
||||
@ -109,6 +140,10 @@
|
||||
- { 'swap_count': "{{ swap_count }}" }
|
||||
- { 'swap_file': "{{ swap_file }}" }
|
||||
- { 'sshd_port': "{{ sshd_port }}" }
|
||||
- { 'git_host': "{{ git_host }}" }
|
||||
- { 'git_user': "{{ git_user }}" }
|
||||
- { 'git_project': "{{ git_project }}" }
|
||||
- { 'git_ssh_port': "{{ git_ssh_port }}" }
|
||||
|
||||
|
||||
## Workstation ##
|
||||
@ -279,28 +314,6 @@
|
||||
;
|
||||
; hugo : Set to true to install HUGO static website generator.
|
||||
;
|
||||
; gitlab : ee - Installs Enterprise Edition Free Tier. Basically CE with an easier upgrade path for Paid Features.
|
||||
; ce - Installs Community Edition. Excludes paid features if you'll never use them. Supposedly difficult to move to EE.
|
||||
; Example: ce
|
||||
;
|
||||
; gitlab_url : The URL prefix for the server. Using 'http://mygitlabserver' would result in "http://mygitlabserver.((domain))".
|
||||
; Regardless of whether you choose http or https, the Certbot config will be skipped since the maintainer uses a reverse proxy.
|
||||
; Example: https://gitlab
|
||||
;
|
||||
; git : Set to true for this server to be configured as an HTTP git server.
|
||||
;
|
||||
; git_name : Name(s) of project(s) that the Git server should host.
|
||||
; Example: ansible#ansible-dev
|
||||
;
|
||||
; git_branch : Branch(es) of project(s) corresponding with git_name.
|
||||
; Example: main#dev
|
||||
;
|
||||
; git_url : URL(s) of project(s) corresponding with git_name.
|
||||
; Example: https://github.com/Hyperling/ansible#https://github.com/Hyperling/ansible
|
||||
;
|
||||
; git_sep : Separator for git variables above.
|
||||
; Example: #
|
||||
;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
[global]
|
||||
marker: '; {mark} MANAGED BY ANSIBLE | Server Config'
|
||||
@ -318,13 +331,6 @@
|
||||
influxdb2: "{{ lookup('ini', 'influxdb2 file={{srv_file}} default=false') }}"
|
||||
certbot: "{{ lookup('ini', 'certbot file={{srv_file}} default=false') }}"
|
||||
hugo: "{{ lookup('ini', 'hugo file={{srv_file}} default=false') }}"
|
||||
gitlab: "{{ lookup('ini', 'gitlab file={{srv_file}} default=false') }}"
|
||||
gitlab_url: "{{ lookup('ini', 'gitlab_url file={{srv_file}} default=false') }}"
|
||||
git: "{{ lookup('ini', 'git file={{srv_file}} default=false') }}"
|
||||
git_name: "{{ lookup('ini', 'git_name file={{srv_file}} default=false') }}"
|
||||
git_branch: "{{ lookup('ini', 'git_branch file={{srv_file}} default=false') }}"
|
||||
git_url: "{{ lookup('ini', 'git_url file={{srv_file}} default=false') }}"
|
||||
git_sep: "{{ lookup('ini', 'git_sep file={{srv_file}} default=false') }}"
|
||||
|
||||
- name: General | Account Management | Provisioning Configuration | Server | List
|
||||
set_fact:
|
||||
@ -338,13 +344,6 @@
|
||||
- { 'influxdb2': "{{ influxdb2 }}" }
|
||||
- { 'certbot': "{{ certbot }}" }
|
||||
- { 'hugo': "{{ hugo }}" }
|
||||
- { 'gitlab': "{{ gitlab }}" }
|
||||
- { 'gitlab_url': "{{ gitlab_url }}" }
|
||||
- { 'git': "{{ git }}" }
|
||||
- { 'git_name': "{{ git_name }}" }
|
||||
- { 'git_branch': "{{ git_branch }}" }
|
||||
- { 'git_url': "{{ git_url }}" }
|
||||
- { 'git_sep': "{{ git_sep }}" }
|
||||
|
||||
|
||||
## Exit if not turned on yet ##
|
||||
|
@ -107,6 +107,16 @@
|
||||
become_user: "{{ user }}"
|
||||
when: user_user.home != ""
|
||||
|
||||
- name: General | Account Management | Users | User | Create Folders | Coding
|
||||
file:
|
||||
path: "{{ item }}"
|
||||
state: directory
|
||||
mode: '0755'
|
||||
loop:
|
||||
- "{{ user_user.home }}/Code"
|
||||
become_user: "{{ user }}"
|
||||
when: user_user.home != "" and coding == true
|
||||
|
||||
- name: General | Account Management | Users | Home Permissions
|
||||
shell: "chmod 700 {{ user_user.home }}/../*"
|
||||
|
||||
@ -118,8 +128,6 @@
|
||||
alias_cp: alias cp='cp -v'
|
||||
alias_mv: alias mv='mv -v'
|
||||
alias_rm: alias rm='echo "Use mv ~/TRASH/ instead!"'
|
||||
alias_clean_dir: alias clean-dir='mv * ~/TRASH/'
|
||||
alias_clean_trash: alias clean-trash='sh -c "rm -rfv ~/TRASH/*"'
|
||||
export_path_additions: export PATH="~/bin:"{{ global_bin }}":$PATH"
|
||||
function_wttr: |
|
||||
function weather() {
|
||||
@ -131,7 +139,7 @@
|
||||
Useful location types:
|
||||
$zip_code | Ex: 12345
|
||||
$city,$state | Ex: Austin,Texas
|
||||
@$domain_dot_extension | Ex: @github.com
|
||||
@$domain_dot_extension | Ex: @gitea.com
|
||||
~$special_location | Ex: ~Manitou Incline
|
||||
Full documentation: https://github.com/chubin/wttr.in'
|
||||
return 1
|
||||
@ -161,6 +169,9 @@
|
||||
|
||||
unset OPTIND
|
||||
unset accept
|
||||
unset goodbye
|
||||
unset only_sys
|
||||
unset only_flat
|
||||
while getopts ":hygsf" opt; do
|
||||
case $opt in
|
||||
h) echo -e "$usage"
|
||||
@ -359,11 +370,23 @@
|
||||
return 0
|
||||
}
|
||||
alias check_trash="check-trash"
|
||||
alias_clean_trash: alias clean-trash='check-trash --clean'
|
||||
alias_trash_check: alias trash-check='check-trash'
|
||||
alias_trash_clean: alias trash-clean='trash-check --clean'
|
||||
alias_clean_dir: |
|
||||
function clean-dir() {
|
||||
clean_dir="`date '+%Y%m%d_%H%M%S'`_CLEANED"
|
||||
trash_dir="$HOME/TRASH/$clean_dir"
|
||||
curr_dir="`pwd`"
|
||||
mkdir -pv "$trash_dir"
|
||||
echo "$curr_dir is being cleaned at `date`." | tee "$trash_dir"/INFO.txt
|
||||
mv -v ..?* .[!.]* * "$trash_dir"/ | tee -a "$trash_dir"/INFO.txt
|
||||
}
|
||||
function_clean: |
|
||||
function clean() {
|
||||
sudo df -h
|
||||
check-trash --clean
|
||||
sudo df -h
|
||||
sudo du -hs
|
||||
clean-dir
|
||||
sudo du -hs
|
||||
}
|
||||
function_flatpak_usage: |
|
||||
function flatpak-usage() {
|
||||
@ -438,10 +461,17 @@
|
||||
alias_code_check: |
|
||||
alias code-check='
|
||||
ls -d ~/Code/* | while read project; do
|
||||
if [[ ! -d $project ]]; then
|
||||
continue
|
||||
fi
|
||||
echo "*** `basename $project` ***"
|
||||
cd $project
|
||||
git pull
|
||||
git push
|
||||
if [[ -d .git ]]; then
|
||||
git pull
|
||||
git push
|
||||
else
|
||||
echo "Not a Git project, skipping!"
|
||||
fi
|
||||
done
|
||||
'
|
||||
alias_code_reset: |
|
||||
@ -456,23 +486,33 @@
|
||||
git checkout dev
|
||||
done
|
||||
'
|
||||
alias_code_reseed: |
|
||||
alias code-reseed='
|
||||
unseed_dir="$HOME/TRASH/`date +%Y-%m-%d`_UnseededCodeProjects"
|
||||
function_code_reseed: |
|
||||
function git_projects_to_sync {
|
||||
cat <<- EOF
|
||||
env-ansible
|
||||
env-docker
|
||||
env-termux
|
||||
nodejs-website
|
||||
android-break-the-habit
|
||||
android-tictactoe
|
||||
android-expense-tracker
|
||||
android-example-database-room
|
||||
android-carb-up
|
||||
ebook-health-protocol
|
||||
EOF
|
||||
}
|
||||
function code-reseed {
|
||||
unseed_dir="$HOME/TRASH/`date ++%Y%m%d_%H%M%S`_UnseededCodeProjects"
|
||||
mkdir -pv "$unseed_dir"
|
||||
mv -v ~/Code/*{ansible,docker,nix,break,website,www,tictactoe,-dev}* \
|
||||
"$unseed_dir"/ 2>/dev/null
|
||||
git clone git@github.com:Hyperling/Ansible \
|
||||
--branch dev ~/Code/ansible-dev
|
||||
git clone git@github.com:Hyperling/Docker \
|
||||
--branch dev ~/Code/docker-dev
|
||||
git clone git@github.com:Hyperling/Website \
|
||||
--branch dev ~/Code/website-dev
|
||||
git clone git@github.com:Hyperling/BreakTheHabit \
|
||||
--branch dev ~/Code/breakthehabit-dev
|
||||
git clone git@github.com:Hyperling/TicTacToeAndroid \
|
||||
--branch dev ~/Code/tictactoe-dev
|
||||
'
|
||||
mv -v ~/Code/* "$unseed_dir"/ 2>/dev/null
|
||||
git_repo_ssh={{ git_repo_ssh }}
|
||||
git_main_project={{ git_project }}
|
||||
git_repo_ssh_basename=${git_repo_ssh//$git_main_project/}
|
||||
git_projects_to_sync | while read git_project; do
|
||||
git clone ${git_repo_ssh_basename}${git_project} \
|
||||
--branch dev ~/Code/$git_project
|
||||
done
|
||||
}
|
||||
function_clean_filenames: |
|
||||
function clean-filenames() {
|
||||
# Must provide the directory you'd like to clean all the filenames in.
|
||||
@ -503,7 +543,7 @@
|
||||
echo -e "\nDone!\n"
|
||||
}
|
||||
alias_clone: |
|
||||
alias clone="rsync -auPh --delete"
|
||||
alias clone="rsync -auPhz --delete"
|
||||
export_hyperling: |
|
||||
export HYPERLING6="2a07:e03:3:80::1"
|
||||
export HYPERLING4="185.130.47.173"
|
||||
@ -513,6 +553,8 @@
|
||||
if [[ -e $DOCKER_SOURCE && $LOGNAME == "root" ]]; then
|
||||
source $DOCKER_SOURCE
|
||||
fi
|
||||
alias_scan: |
|
||||
alias scan="nmap -A -p- --script=vuln"
|
||||
|
||||
- name: General | Account Management | Users | Files | Common Variable
|
||||
set_fact:
|
||||
@ -547,12 +589,13 @@
|
||||
{{ alias_docker_restart }}
|
||||
{{ alias_code_check }}
|
||||
{{ alias_code_reset }}
|
||||
{{ alias_code_reseed }}
|
||||
{{ function_code_reseed }}
|
||||
{{ function_clean_filenames }}
|
||||
{{ function_clean_filenames_tree }}
|
||||
{{ alias_clone }}
|
||||
{{ export_hyperling }}
|
||||
{{ source_docker_env }}
|
||||
{{ alias_scan }}
|
||||
|
||||
- name: General | Account Management | Users | Files | .bashrc
|
||||
blockinfile:
|
||||
|
@ -6,7 +6,7 @@
|
||||
user: ansible
|
||||
name: "Ansible Sync"
|
||||
minute: "*/30"
|
||||
job: "sudo {{ ansible_pull_exec.stdout }} -o -U {{ repo_local }} --checkout {{ branch }}"
|
||||
job: "sudo {{ ansible_pull_exec.stdout }} -o -U {{ git_repo_http }} --checkout {{ branch }}"
|
||||
state: present
|
||||
disabled: "{{ 'yes' if no_telem else 'no' }}"
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
path: "{{ user_root.home }}/bin/scm.sh"
|
||||
block: |
|
||||
# 20210211 - Make life easier!
|
||||
git clone {{ repo_github }} ansible-pull
|
||||
git clone {{ git_repo_http }} ansible-pull
|
||||
ansible-pull/setup.sh
|
||||
mv ansible-pull ~/TRASH/
|
||||
marker: '{mark}'
|
||||
@ -37,7 +37,7 @@
|
||||
|
||||
## Main ##
|
||||
|
||||
time {{ ansible_pull_exec.stdout }} -U {{ repo_github }} --checkout $branch
|
||||
time {{ ansible_pull_exec.stdout }} -U {{ git_repo_http }} --checkout $branch
|
||||
|
||||
marker: '{mark}'
|
||||
marker_begin: "#!{{ bash_exec.stdout }}"
|
||||
|
@ -6,7 +6,7 @@
|
||||
path: "{{ user_user.home }}/bin/scm.sh"
|
||||
block: |
|
||||
# 20210211 - Make life easier!
|
||||
git clone {{ repo_github }} ansible-pull
|
||||
git clone {{ git_repo_http }} ansible-pull
|
||||
ansible-pull/setup.sh
|
||||
mv ansible-pull ~/TRASH/
|
||||
marker: '{mark}'
|
||||
@ -37,7 +37,7 @@
|
||||
|
||||
## Main ##
|
||||
|
||||
time sudo {{ ansible_pull_exec.stdout }} -U {{ repo_github }} --checkout $branch
|
||||
time sudo {{ ansible_pull_exec.stdout }} -U {{ git_repo_http }} --checkout $branch
|
||||
|
||||
marker: '{mark}'
|
||||
marker_begin: "#!{{ bash_exec.stdout }}"
|
||||
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
# Update the Nix configuration at github.com/Hyperling/NixOS.
|
||||
# Update the Nix configuration at git.hyperling.com/me/env-nixos.
|
||||
# This is also done in setup.sh if ansible is not found.
|
||||
|
||||
- name: General | Software | NixOS | Facts
|
||||
@ -19,7 +19,7 @@
|
||||
blockinfile:
|
||||
path: /etc/nixos/ansible.nix
|
||||
block: |
|
||||
# This file was created by https://github.com/Hyperling/Ansible
|
||||
# This file was created by https://git.hyperling.com/me/env-ansible
|
||||
# Please do not alter it by hand. Use the proper ini files instead.
|
||||
{ config, pkgs, nix, ... }:
|
||||
|
||||
|
@ -55,6 +55,7 @@
|
||||
- vim
|
||||
- "{{ cron }}"
|
||||
- "{{ encfs }}"
|
||||
- rsync
|
||||
state: present
|
||||
|
||||
- name: General | Software | Packages | Install Software (DEV)
|
||||
|
Reference in New Issue
Block a user