Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Colm/student media #87

Open
wants to merge 712 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
712 commits
Select commit Hold shift + click to select a range
258bd74
removed serial console role (supported by cloudinit images/uefi by de…
ocanty Jan 23, 2021
e466076
removed traefik role
ocanty Jan 23, 2021
33a1fdc
template playbooks
ocanty Jan 23, 2021
a061441
added proxmox lxc role
ocanty Jan 23, 2021
933207d
added proxmox templates generation role
ocanty Jan 23, 2021
d2cfbcd
moved proxmox host keys to ./keys/
ocanty Jan 23, 2021
e2427f5
delete temporary ssh keys when done
ocanty Jan 23, 2021
80dab9e
updated ansible
ocanty Jan 23, 2021
8fb4a3a
removed packer dhcp bridge role
ocanty Jan 23, 2021
2d60d2a
removed packer-proxmox-template role
ocanty Jan 23, 2021
f3ac67b
modified vm create role
ocanty Jan 23, 2021
e345f69
added dhcp vlan/subnet to vars/network.yml
ocanty Jan 23, 2021
f118b51
added proxmox template provision playbook
ocanty Jan 23, 2021
85e8701
Merge branch 'master' of github.com:UCCNetsoc/NaC
ocanty Jan 23, 2021
0757840
changed disk format for lxc and vm roles
ocanty Jan 23, 2021
943bea2
use correct certresolvers for cloud api
ocanty Jan 24, 2021
be26fe3
updated ansible
ocanty Jan 24, 2021
824acc1
added tags for cloud and api
ocanty Jan 24, 2021
f543a7a
alans ssh key
ocanty Jan 24, 2021
bd7ab71
finished templates
ocanty Jan 25, 2021
73acf0e
removed images from cloud config and set inactivity dates
ocanty Jan 25, 2021
da612af
removed ansible role that was breaking everything, removed cloud-lxc-…
ocanty Jan 25, 2021
dd81183
adjusted traefik http poll time
ocanty Jan 25, 2021
7cd55ca
added tasks for shortener database and infra-web, added secrets for d…
gal Jan 25, 2021
5fd7d94
added links.netsoc.co to external dns
gal Jan 25, 2021
e3d18a3
moved shortener stuff above loki targets
gal Jan 25, 2021
94452f0
added traefik http auth for shortener
gal Jan 25, 2021
1871676
fixed ssh issue
ocanty Jan 25, 2021
fdc3db7
Added discord bot panel update
ericm Jan 26, 2021
6a31c50
Merge branch 'master' of https://github.com/UCCNetsoc/NaC
ericm Jan 26, 2021
e379684
GhostCMS Template
jac Jan 26, 2021
f5052ee
Reduced GhostCMS Template RAM allocation. Set container to restart al…
jac Jan 26, 2021
9522651
Non root template provisioning
jac Jan 26, 2021
b1f08f3
removed implicit leela fallback
ocanty Jan 26, 2021
d3c79a5
Merge branch 'master' of github.com:UCCNetsoc/NaC
ocanty Jan 26, 2021
e655d03
Ghost Config Tool html overhaul
jac Jan 26, 2021
7de156d
Increase GhostCMS installation poll attempts
jac Jan 29, 2021
a81affc
Add base web entry for semaphore
ericm Jan 29, 2021
44a3992
Added mysql to semaphore
ericm Jan 29, 2021
74d5cc6
Mysql bug fix
ericm Jan 29, 2021
0d5d2a4
Merge branch 'master' of https://github.com/UCCNetsoc/NaC
ericm Jan 29, 2021
62fdb6f
updated vars, fixed yml errors
gal Feb 6, 2021
835e33e
updated secrets, added shortener secrets to discord-bot
gal Feb 6, 2021
16c13be
changed traefik authenticated router to /api on shortener
gal Feb 6, 2021
ebdf526
fixed syntax errors
gal Feb 6, 2021
8b4685c
moved student media to its own container
ocanty Feb 11, 2021
314314a
Merge branch 'master' of github.com:UCCNetsoc/NaC
ocanty Feb 11, 2021
f062824
fixed traefik metrics collection
ocanty Feb 12, 2021
8e1779c
Bump Grafana to 7.4.1. Install piechart panel
jac Feb 12, 2021
456f407
Use secureJsonData for loki basicAuthPassword
jac Feb 12, 2021
a029f07
Set resource limit for loki
ericm Feb 12, 2021
674f949
change ssh key
jac Feb 16, 2021
8a9df87
Build templates on leela
jac Feb 17, 2021
0169da3
Fix var name typo in build-vm-template
jac Feb 17, 2021
c53c5f4
set gopath so gopls and etc when installed as binaries work outside t…
ocanty Feb 19, 2021
e1d6a68
Ensure Golang installed for building Ghost config
jac Feb 19, 2021
474a4df
blacklisted lovelace for netsoc cloud
ocanty Mar 3, 2021
3468c0f
HLM website redirect
jac Mar 4, 2021
88ded27
Netcraft container
jac Mar 9, 2021
83a8d1b
reverse proxy student media on new ucc vm
ocanty Mar 16, 2021
f56249a
Merge branch 'master' of github.com:UCCNetsoc/NaC
ocanty Mar 16, 2021
adf64e4
Bump jinja2 from 2.11.2 to 2.11.3
dependabot[bot] Mar 20, 2021
26ad052
Add new facebook token during da agm
ericm Mar 23, 2021
ac62b68
Add new FB token. Should expire in ~3 months
ericm Mar 25, 2021
c182c34
Bump pyyaml from 5.3.1 to 5.4
dependabot[bot] Mar 26, 2021
4c173fc
added pull for traefik, shortener, updated bot environment variables
gal Mar 31, 2021
d481d71
Merge pull request #54 from UCCNetsoc/dependabot/pip/pyyaml-5.4
ericm Mar 31, 2021
efa599a
Merge pull request #47 from UCCNetsoc/dependabot/pip/cryptography-3.2
ericm Mar 31, 2021
ac01f43
Merge pull request #53 from UCCNetsoc/dependabot/pip/jinja2-2.11.3
ericm Mar 31, 2021
841783c
Bump cryptography from 3.2 to 3.3.2
dependabot[bot] Mar 31, 2021
83450c7
Merge pull request #55 from UCCNetsoc/dependabot/pip/cryptography-3.3.2
ericm Mar 31, 2021
fb01cc0
Revert cryptography
ericm Mar 31, 2021
3698b20
Revert dependabot's breaking changes
ericm Mar 31, 2021
d366743
merged from master, removed shorten.domain variable, fixed environmen…
gal Apr 3, 2021
bfe6a9d
Merge pull request #51 from UCCNetsoc/add_shortener
ericm Apr 3, 2021
e364d74
Update traefik dash with variable
ericm Apr 3, 2021
02e8dce
Update traefik dash
ericm Apr 3, 2021
04c7701
Increase file upload size limit
jac Apr 10, 2021
df03dd6
removed invalid domains from legacy-leela web
gal Apr 19, 2021
aff4fc2
fixed leela https-fallback, commented-out evans old router
gal Apr 19, 2021
c5b7b9e
Add fallback back
ericm Apr 27, 2021
4821c43
Updated bot FB token (expires July 28)
ericm May 29, 2021
a2d054b
Fix secrets breaking start-dev
ericm Jun 12, 2021
1e04f28
Update grafana to 8.0.1
ericm Jun 12, 2021
826d0a1
Setup grafana with keycloak for sysadmins
ericm Jun 12, 2021
3cadac2
updated cloud webhook url for discord
gal Jun 19, 2021
d4b5d13
Merge branch 'master' of https://github.com/uccnetsoc/nac
gal Jun 19, 2021
f1aa326
Updated discord role to Signups 2021/2022
ericm Jun 19, 2021
2955d5b
Added bot to new committee server
ericm Jun 19, 2021
6ec4abf
Added export-grafana-dashboards playbook
ericm Jun 26, 2021
c10e96b
Add other dashboards for provisioning
ericm Jun 26, 2021
ed5adc4
Format dashboards
ericm Jun 26, 2021
4d6a4d2
Added formated dashboards
ericm Jun 26, 2021
4c9e458
New shortener: netsoc.co/go
ericm Jul 1, 2021
70cb70a
Fixing shortener in bot
ericm Jul 1, 2021
3636484
Added proxmox.netsoc.co
ericm Jul 2, 2021
592a54c
Added container logs dash
ericm Jul 2, 2021
550e4a8
Add robots.txt
ericm Jul 4, 2021
c53bd36
Update CI Webhook
jac Jul 3, 2021
577c289
Added new facebook token for bot (expires 3 October)
ericm Aug 4, 2021
93d7c3b
merge secrets
ericm Aug 4, 2021
836dcbb
Added new facebook token for bot (expires 3 October)
ericm Aug 4, 2021
2f7fe2f
Add build status
ericm Aug 4, 2021
d595a84
added reece's ssh key
ReeceDonovan Aug 4, 2021
8e11dc9
Merge pull request #60 from ReeceDonovan/master
gal Aug 4, 2021
c28fcfd
Ensured shortener image gets pulled each time
ReeceDonovan Aug 5, 2021
39b5075
updated grafana webhook url
gal Aug 15, 2021
b0334ab
Added interactive vm-ssh.sh options
ericm Sep 4, 2021
ac4956b
Added semaphore playbook auth
ericm Sep 4, 2021
9ec28cd
Added github actions account to control host
ericm Sep 6, 2021
b2a5935
Only ask for env var if required
ericm Sep 6, 2021
829cacd
vault_pass->VAULT_PASS
ericm Sep 6, 2021
a338cd0
Update discord bot to GHCR
ericm Sep 7, 2021
d5187d7
Add whodis secrets to vault
jac Sep 7, 2021
95d76a2
Added ansible vault merge driver
ericm Sep 7, 2021
d44d067
Blank line to test merge
ericm Sep 7, 2021
28411dd
+x vault merge
ericm Sep 7, 2021
f200faf
Merge branch 'master' of https://github.com/UCCNetsoc/NaC
ericm Sep 7, 2021
35715c8
Turn on log rotation for Traefik
jac Sep 9, 2021
5f7f0c5
Reduce Prom retention length. Decrease scrape frequency
jac Sep 10, 2021
f3e06c2
Added whodis invite link to vault
ReeceDonovan Sep 12, 2021
cc74b83
Added whodis to infra-web playbook
ReeceDonovan Sep 12, 2021
91f784a
Fix whodis invite
ericm Sep 12, 2021
d2644a8
Added additional role
ericm Sep 12, 2021
8f492ea
Added additional role fix
ericm Sep 12, 2021
99c91e4
Changed discord invite so that it points to new registration channel …
ericm Sep 12, 2021
137acdb
ghcr netsoc.co
ericm Sep 16, 2021
774463b
ghcr netsoc cloud
ericm Sep 16, 2021
d7293eb
Add Proxmox host scalper
jac Sep 17, 2021
e14b7a7
Recreate Templates
jac Sep 17, 2021
3cb59f9
Added filter to remove vps's from vm-ssh
ericm Sep 19, 2021
a9ffda8
Migrate start dev to fish for better auto complete
ericm Sep 19, 2021
06afbdf
Added bash start dev option
ericm Sep 19, 2021
6737dfe
All .sh scripts in NaC are global. EG: 'run provision-infra-web.yml' …
ericm Sep 19, 2021
b546d00
Merge branch 'master' of https://github.com/UCCNetsoc/NaC
ericm Sep 19, 2021
f82c5dd
Bash default start-dev
ericm Sep 19, 2021
89a3032
Add whodis custom welcome message
ericm Sep 19, 2021
b5e6477
Update webssh2 to GHCR
ericm Sep 19, 2021
bdc11f3
Fixed default welcome message for whodis
ReeceDonovan Sep 23, 2021
b559190
Update README.md
ericm Sep 23, 2021
c69398a
Fix proxmox.netsoc.co by proxying scalper
ericm Sep 24, 2021
2a64db8
Merge branch 'master' of https://github.com/UCCNetsoc/NaC
ericm Sep 24, 2021
b8ad372
Change control host to proxmox
ericm Sep 25, 2021
56515f8
vm-ssh works with infra containers
ericm Sep 25, 2021
e8bc596
Ansible readable ssh username
ericm Sep 25, 2021
0fc3a7e
Create minecraft infra
ericm Sep 25, 2021
e9b58d0
Minecraft provisioned
ericm Sep 25, 2021
33145fa
Minecraft DNS
ericm Sep 25, 2021
51b5b20
minecraft on cix3
ericm Sep 25, 2021
dc8e347
Minecraft updates
ericm Sep 25, 2021
4190221
Better MOTD
ericm Sep 25, 2021
8867c7b
minecraft.netsoc.co redirect
jac Sep 25, 2021
37fd849
Add MC to prom
ericm Sep 26, 2021
9879d0a
Fix Prom targets
jac Sep 26, 2021
671d011
Update dashboards
ericm Sep 26, 2021
13f68c3
Merge branch 'master' of https://github.com/UCCNetsoc/NaC
ericm Sep 26, 2021
0b8d6c9
Provision Minecraft with more dedicated wam
ericm Sep 27, 2021
8d338df
Change MC server ports
jac Sep 27, 2021
9348d1e
More ram in container
ericm Sep 27, 2021
a238623
Merge branch 'master' of https://github.com/UCCNetsoc/NaC
ericm Sep 27, 2021
17e9556
Change voice mod port
jac Sep 27, 2021
1c79179
Update Ghost CMS Version
jac Sep 27, 2021
50560d5
Add 'netsoc_cloud' resource pool
jac Sep 28, 2021
d08c6a9
Improved minecraft dashboard
ericm Sep 28, 2021
e2c3cc9
Merge branch 'master' of https://github.com/UCCNetsoc/NaC
ericm Sep 28, 2021
def7d57
Ensure all template packages are up to date
jac Oct 3, 2021
0d01ec0
Merge pull request #63 from UCCNetsoc/template-packages
ericm Oct 3, 2021
c13d0d0
Fix keycloak export
jac Oct 4, 2021
7e618fd
Merge pull request #64 from UCCNetsoc/fix-keycloak-export
ericm Oct 4, 2021
b7089ee
Remove semaphore
ericm Oct 6, 2021
c8b92c9
Remove drone
ericm Oct 6, 2021
54e8ab1
Remove from secrets
ericm Oct 6, 2021
5ba39aa
Remove drone from secrets mapping
ericm Oct 6, 2021
b07f903
Merge pull request #65 from UCCNetsoc/delet
gal Oct 6, 2021
a47bb8f
Update wiki js
ericm Oct 8, 2021
503314a
Add Minecraft Player Stats dashboard
ericm Oct 9, 2021
7c676bc
Added grafana oauth
ericm Oct 9, 2021
1ffe4b5
Added grafana keycloak fixes
ericm Oct 9, 2021
9801ce1
Better minecraft dashboard
ericm Oct 10, 2021
6259e59
Added create mod config
ericm Oct 10, 2021
7513b89
Merge pull request #66 from UCCNetsoc/mcc
ReeceDonovan Oct 11, 2021
5afcbb1
Added google calendar URL and event default image URL for netsoc bot
ReeceDonovan Oct 11, 2021
038be7e
Adding event banner toggle for netsoc.co to NaC
ReeceDonovan Oct 12, 2021
9fd21ea
Removed unused vars for netsoc.co
ReeceDonovan Oct 12, 2021
051cd40
Add build competition dns
ericm Oct 16, 2021
96623db
Merge branch 'master' of https://github.com/UCCNetsoc/NaC
ericm Oct 16, 2021
2a17725
Added committee calendar link to vault and whodis for use in committe…
ReeceDonovan Oct 23, 2021
57ee96c
Added whodis log parsing to existing loki queries
ReeceDonovan Oct 23, 2021
e3e3111
Change default image for bot
ericm Nov 1, 2021
bede50a
Fixed netsoc bot
ericm Nov 1, 2021
32c6d30
Added Plausible: http://analytics.netsoc.co
ericm Dec 9, 2021
2e42db3
Update setup-control-host.yml
ciarancotter Dec 24, 2021
97254b7
Add grafana keycloak client
ericm Dec 24, 2021
be83323
add colm's ssh key to setup-control-host.yml
Feb 1, 2022
686d077
Merge pull request #67 from colmmurphyxyz/add_ssh_key
gal Feb 1, 2022
defdbce
fixed syntax of json key
gal Feb 1, 2022
e294ebf
fixed the problem ;)
ericm Mar 4, 2022
35724d4
Add handbook.netsoc.co DNS record
jac Mar 27, 2022
155e347
refactored minecraft ansible and updated server
minMaximilian Apr 10, 2022
9b40b8e
review changes
minMaximilian Apr 10, 2022
1285166
testing java17
minMaximilian Apr 10, 2022
678037d
switching from openj9 to jdk
minMaximilian Apr 10, 2022
a4195eb
manifest changes
minMaximilian Apr 10, 2022
377b4ca
Removed config files to check if the server launches
minMaximilian Apr 10, 2022
1c30dda
shrug
minMaximilian Apr 10, 2022
658cc3e
Revert "shrug"
minMaximilian Apr 10, 2022
850b552
Merge pull request #69 from minMaximilian/master
ericm Apr 12, 2022
730275a
added ssh key
minMaximilian Apr 12, 2022
1dce455
Merge pull request #70 from minMaximilian/master
ericm Apr 12, 2022
5604210
Fix requirements issue
ericm Apr 12, 2022
79db993
updated whodis bot token
gal Jun 20, 2022
5b9c2b3
Updated freeipa admin password in vault
ReeceDonovan Jun 20, 2022
f104694
Updated freeipa admin password in keycloak-realm-export
ReeceDonovan Jun 20, 2022
51d2fac
Updated freeipa admin password in netsoc-cloud-api-config
ReeceDonovan Jun 20, 2022
5e7425f
forgot my passkey :(
colmmurphyxyz Jul 22, 2022
5e8e9aa
added meabh's ssh key
meabhdoyle Aug 8, 2022
4e59e6f
adding TVWhiteNoise's ssh key
Dolan-M Aug 8, 2022
c8200d3
Merge pull request #76 from TVWhiteNoise/master
gal Aug 8, 2022
0c61601
added meabh's ssh key
meabhdoyle Aug 8, 2022
5894de7
Merge branch 'master' into master
gal Aug 8, 2022
110a8a7
Merge pull request #74 from meabhdoyle/master
gal Aug 8, 2022
ddd2489
updated blog to run on ghost
meabhdoyle Aug 9, 2022
1e352de
update DNS for statuspage
gal Aug 16, 2022
5ae38bc
add secrets, image tag and env
gal Aug 16, 2022
33051ca
Add shang to as 'temp' sysadmin
sh-angl Sep 16, 2022
0a3a8ba
Merge pull request #78 from sh-angl/sh-angl-add-shang
gal Sep 16, 2022
2fb3a0b
first pass at foundry template
sh-angl Sep 17, 2022
a95050d
fixed bad name of ansible ttask
sh-angl Sep 17, 2022
6d3cff4
added it to proxmox provisions
sh-angl Sep 17, 2022
fd6a55d
fixed fmting dissues
sh-angl Sep 17, 2022
21b4ae4
fixed description, updated port to 80 and fixed minor bugs
sh-angl Sep 17, 2022
963e283
fixed filepath issu for secrests.json
sh-angl Sep 17, 2022
9702c1d
fixed path to be linux specific
sh-angl Sep 17, 2022
0a1152b
updated to use download url instead of license cause i was wrong on h…
sh-angl Sep 17, 2022
7b93e69
changed to dl_url to be env var
sh-angl Sep 17, 2022
f8dbb09
fix for wrong path
sh-angl Sep 17, 2022
b1d0970
fixed using wrong template
sh-angl Sep 17, 2022
a7a5d78
fixing env file plus adding the missing env section
sh-angl Sep 17, 2022
db37f7e
updated foundry timed url instructions
sh-angl Sep 24, 2022
5db54e5
Update Foundry VTT Logo
sh-angl Oct 4, 2022
ed4adee
Merge pull request #79 from sh-angl/foundry_template
gal Oct 4, 2022
cb4b9f1
Add Victor's ssh key to control host
v-pan Jan 11, 2023
832161d
Remove email from ssh key
v-pan Jan 11, 2023
d43f9ee
Merge pull request #82 from paranoidcake/master
gal Jan 11, 2023
4907d98
Added SSH key
SequeI Jan 11, 2023
b360b3d
Merge pull request #84 from Virtus0x/master
gal Jan 11, 2023
2a5d36a
move motley to web vm
colmmurphyxyz Mar 22, 2023
14664ae
Merge branch 'master' of https://github.com/UCCNetsoc/NaC
colmmurphyxyz Mar 23, 2023
c58e205
write uccexpress play
colmmurphyxyz Mar 23, 2023
4fac427
update .gitignore
colmmurphyxyz Apr 4, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*.yml]
indent_size = 2
indent_style = space

[*.sh]
indent_size = 4
indent_style = tab
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
vars/secrets.yml diff=ansible-vault merge=ansible-vault
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
keys/*
keys*
include
bin/
lib/
*.retry
keys/
production
_vault_pass
_secrets.yml
share/
1 change: 1 addition & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions .nojekyll
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

4 changes: 4 additions & 0 deletions .prettierrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
trailingComma: "es5"
tabWidth: 2
semi: true
singleQuote: true
58 changes: 31 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,42 +1,46 @@
Netsoc Ansible
=========
<img src="https://github.com/UCCNetsoc/wiki/raw/master/assets/logo-service-nac.svg" width="360"/>

## Local Development
## I'm a new SysAdmin, what the heck do I do?

### Prerequisites
* `ssh` into the Ansible control server (currently `control.netsoc.co:2222`)
* `ssh <username>@control.netsoc.co -p 2222 -i <path to ssh key>`
* If you have not supplied an SSH key to the Head SysAdmin already:
* Open a PR adding your username and key to `setup-control-host.yml`

1. Hashicorp Packer
2. LXD up and running
* Clone this repo

### How 2
* Run `./start-dev.sh` inside the cloned folder (or `./start-dev.sh fish` to use fish instead of bash)
* You will need to run `./start-dev.sh` to setup the correct Python packages and environment variables. You must do this before beginning any development/deployment
* You will be able to tell you have done this when your terminal prompt looks like this:
* `(NaC) <user>@feynman:~/NaC#`

1. Run `./simulation.sh` and wait for everything to startup.
2. Go ham and run some playbooks!
* You will need a `keys/` folder which contains SSH keys to target all physical and virtual machines. Ask the Head SysAdmin for this.
* Do **NOT** commit them or remove the `keys/` clause from `.gitignore`.
* Do **NOT** share them with people who are not SysAdmins
* Do **NOT** leave them sitting on a random server somewhere

The simulation may need to be torn down and brought back up after PC restarts.
* You can peek and edit the vault using `./vault-peek.sh` and `./vault-edit.sh`

SSH Keys are generated and placed into the correct directories. You can SSH to each container/host using username `netsoc` and password `borger`
* You can list *.vm.netsoc.co by using `./vm-list.sh`
* You can ssh into *.vm.netsoc.co by running `./vm-ssh.sh <hostname>`, i.e `./vm-ssh.sh web.infra.netsoc.co`

Make sure not to commit the host_vars with changed IPs.
* The Proxmox Web UI is available at [`proxmox.netsoc.co`](https://proxmox.netsoc.co). You may need to type `thisisunsafe` (if using Chrome) to get past the SSL warning

## Misc Info
* For your development, you can use `sshfs` / VSCode Remote / `vim` on the control server / a git branch.
* You _will_ need to run your playbooks on the control server

ssh priv key structure:
`/keys/<host>/id_rsa`

i.e for feynman
`/keys/feynman/id_rsa`
## I want to contribute but I'm not a SysAdmin?

`/vars/cloudflare.yml` format:
* Consider making an issue or contact us in `#servers` in our [Discord](https://discord.netsoc.co)
* We'll welcome any help!

```yaml
cf_api_email: <cloudflare email>
cf_api_key: <cloudflare api key>
```
## I like this repo and want to learn more about UCC Netsoc

`/vars/freeipa.yml` format:
* Check out our [wiki](https://wiki.netsoc.co)

```yaml
ipa_ds_password: <directory server pass>
ipa_admin_password: <admin pass>
```
## **Important**

This repo currently contains both playbooks for managing 2019/2020 bare-metal infra and 2020/2021 Proxmox infra. Do not get them confused, have a look at `./hosts` to see what's going on.

### **Read [wiki.netsoc.co](wiki.netsoc.co)**
8 changes: 7 additions & 1 deletion ansible.cfg
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
[defaults]
inventory = ./hosts
nocows = 1
nocows = 1

# Use the YAML callback plugin.
stdout_callback = debug

# Use the stdout_callback when running ad-hoc commands.
bin_ansible_callbacks = True
13 changes: 0 additions & 13 deletions backplane.yml

This file was deleted.

19 changes: 0 additions & 19 deletions base.yml

This file was deleted.

34 changes: 34 additions & 0 deletions bass.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# MIT License
#
# Copyright (c) 2017 Eddie Cao
# https://github.com/edc/bass

function bass
set -l bash_args $argv
set -l bass_debug
if test "$bash_args[1]_" = '-d_'
set bass_debug true
set -e bash_args[1]
end

set -l script_file (mktemp)
if command -v python3 >/dev/null 2>&1
command python3 -sS (dirname (status -f))/bass.py $bash_args 3>$script_file
else
command python -sS (dirname (status -f))/bass.py $bash_args 3>$script_file
end
set -l bass_status $status
if test $bass_status -ne 0
return $bass_status
end

if test -n "$bass_debug"
cat $script_file
end
source $script_file
command rm $script_file
end

function __bass_usage
echo "Usage: bass [-d] <bash-command>"
end
141 changes: 141 additions & 0 deletions bass.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
"""
MIT License

Copyright (c) 2017 Eddie Cao
https://github.com/edc/bass

To be used with a companion fish function like this:
function refish
set -l _x (python /tmp/bass.py source ~/.nvm/nvim.sh ';' nvm use iojs); source $_x; and rm -f $_x
end
"""

from __future__ import print_function

import json
import os
import signal
import subprocess
import sys
import traceback


BASH = 'bash'

FISH_READONLY = [
'PWD', 'SHLVL', 'history', 'pipestatus', 'status', 'version',
'FISH_VERSION', 'fish_pid', 'hostname', '_', 'fish_private_mode'
]

IGNORED = [
'PS1', 'XPC_SERVICE_NAME'
]

def ignored(name):
if name == 'PWD': # this is read only, but has special handling
return False
# ignore other read only variables
if name in FISH_READONLY:
return True
if name in IGNORED or name.startswith("BASH_FUNC"):
return True
return False

def escape(string):
# use json.dumps to reliably escape quotes and backslashes
return json.dumps(string).replace(r'$', r'\$')

def escape_identifier(word):
return escape(word.replace('?', '\\?'))

def comment(string):
return '\n'.join(['# ' + line for line in string.split('\n')])

def gen_script():
# Use the following instead of /usr/bin/env to read environment so we can
# deal with multi-line environment variables (and other odd cases).
env_reader = "%s -c 'import os,json; print(json.dumps({k:v for k,v in os.environ.items()}))'" % (sys.executable)
args = [BASH, '-c', env_reader]
output = subprocess.check_output(args, universal_newlines=True)
old_env = output.strip()

pipe_r, pipe_w = os.pipe()
if sys.version_info >= (3, 4):
os.set_inheritable(pipe_w, True)
command = 'eval $1 && ({}; alias) >&{}'.format(
env_reader,
pipe_w
)
args = [BASH, '-c', command, 'bass', ' '.join(sys.argv[1:])]
p = subprocess.Popen(args, universal_newlines=True, close_fds=False)
os.close(pipe_w)
with os.fdopen(pipe_r) as f:
new_env = f.readline()
alias_str = f.read()
if p.wait() != 0:
raise subprocess.CalledProcessError(
returncode=p.returncode,
cmd=' '.join(sys.argv[1:]),
output=new_env + alias_str
)
new_env = new_env.strip()

old_env = json.loads(old_env)
new_env = json.loads(new_env)

script_lines = []

for k, v in new_env.items():
if ignored(k):
continue
v1 = old_env.get(k)
if not v1:
script_lines.append(comment('adding %s=%s' % (k, v)))
elif v1 != v:
script_lines.append(comment('updating %s=%s -> %s' % (k, v1, v)))
# process special variables
if k == 'PWD':
script_lines.append('cd %s' % escape(v))
continue
else:
continue
if k == 'PATH':
value = ' '.join([escape(directory)
for directory in v.split(':')])
else:
value = escape(v)
script_lines.append('set -g -x %s %s' % (k, value))

for var in set(old_env.keys()) - set(new_env.keys()):
script_lines.append(comment('removing %s' % var))
script_lines.append('set -e %s' % var)

script = '\n'.join(script_lines)

alias_lines = []
for line in alias_str.splitlines():
_, rest = line.split(None, 1)
k, v = rest.split("=", 1)
alias_lines.append("alias " + escape_identifier(k) + "=" + v)
alias = '\n'.join(alias_lines)

return script + '\n' + alias

script_file = os.fdopen(3, 'w')

if not sys.argv[1:]:
print('__bass_usage', file=script_file, end='')
sys.exit(0)

try:
script = gen_script()
except subprocess.CalledProcessError as e:
sys.exit(e.returncode)
except Exception:
print('Bass internal error!', file=sys.stderr)
raise # traceback will output to stderr
except KeyboardInterrupt:
signal.signal(signal.SIGINT, signal.SIG_DFL)
os.kill(os.getpid(), signal.SIGINT)
else:
script_file.write(script)
5 changes: 0 additions & 5 deletions blog.yml

This file was deleted.

21 changes: 0 additions & 21 deletions build-vyos-router-iso.yml

This file was deleted.

11 changes: 0 additions & 11 deletions ci.yml

This file was deleted.

8 changes: 0 additions & 8 deletions consul.yml

This file was deleted.

Loading