diff --git a/Makefile b/Makefile deleted file mode 100644 index 8d5f92a..0000000 --- a/Makefile +++ /dev/null @@ -1,5 +0,0 @@ -all: - ansible-playbook playbooks/all.yml - -%: - ansible-playbook playbooks/all.yml --tags "$@" diff --git a/README.md b/README.md index 7a0bc9a..6276c41 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,7 @@ As an intermediate solution, I can just put the password in keepass... - More cool plugins :) - dropdown autocomplete - fzf in vim? telescope or something +- https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#yamlls ## Long-term TODO diff --git a/playbooks/all.yml b/playbooks/laptop.yml similarity index 74% rename from playbooks/all.yml rename to playbooks/laptop.yml index 2a2edba..f0a0d0f 100644 --- a/playbooks/all.yml +++ b/playbooks/laptop.yml @@ -4,23 +4,25 @@ - role: system tags: [system] - role: bash - tags: [bash, os3] + tags: [bash] - role: alacritty - tags: [alacritty, os3] + tags: [alacritty] - role: wireguard tags: [wireguard] - role: asdf tags: [asdf] - role: neovim - tags: [neovim, os3] + tags: [neovim] - role: signal - tags: [signal, os3] + tags: [signal] - role: virtualbox tags: [virtualbox] - role: vscodium - tags: [vscodium, os3] + tags: [vscodium] - role: syncthing tags: [syncthing] + vars: + syncthing_profile: "laptop" - role: strawberry tags: [strawberry] - role: nicotine diff --git a/playbooks/os3.yml b/playbooks/os3.yml new file mode 100644 index 0000000..69068c9 --- /dev/null +++ b/playbooks/os3.yml @@ -0,0 +1,19 @@ +- name: Setup system + hosts: self + roles: + - role: system + tags: [system] + - role: bash + tags: [bash] + - role: alacritty + tags: [alacritty] + - role: neovim + tags: [neovim] + - role: signal + tags: [signal] + - role: vscodium + tags: [vscodium] + - role: syncthing + tags: [syncthing] + vars: + syncthing_profile: "os3" diff --git a/roles/syncthing/files/cert.pem b/roles/syncthing/files/laptop/cert.pem similarity index 100% rename from roles/syncthing/files/cert.pem rename to roles/syncthing/files/laptop/cert.pem diff --git a/roles/syncthing/files/key.pem b/roles/syncthing/files/laptop/key.pem similarity index 100% rename from roles/syncthing/files/key.pem rename to roles/syncthing/files/laptop/key.pem diff --git a/roles/syncthing/files/os3/cert.pem b/roles/syncthing/files/os3/cert.pem new file mode 100644 index 0000000..0d0d585 --- /dev/null +++ b/roles/syncthing/files/os3/cert.pem @@ -0,0 +1,45 @@ +$ANSIBLE_VAULT;1.1;AES256 +39323562326337633131623830353663626538646436616535383534363862623439353966373065 +3333663932336566623865663130633030353761656639610a346163363232373563626265636231 +35383439366632313962383035356461306461643066633932636130383232336533393961613131 +6361333235626538620a366166303563623762386338303862323930373730306264363261376430 +32376233363837653932366137636330343562376566383566666363616461383134643962353635 +61613639326366346135623139326435643832323836376639313864396362353830616334383431 +64333766643435626337653130396566653765633239663039366431393638316238316539353836 +62333837393633623035343064656465376531353933376632363936316338366634366462323833 +65646234663634313631623964613036383864346164343134613237333434383838353230636164 +30373336323363623030303862613834626162303633376264326534663439363866316139363135 +37646432306331333362306533333665643131346636353666613332393937383835323431356366 +30386337646436366362333962663534656365316637653366663566646665383737656130393437 +62316462366238353230323737353731616331616366303066643564363562393938636265366139 +36343034353034306563373135333632323866326330313632666666353933653065336463336533 +36313631633836646434636236306262323734346339373533396433633334333364613263393064 +34633162373538623038343535306431306538303164313763326337313765303136353962323364 +63623963366531633339306631343038666131656462616634666631343237353939633531663632 +61376130613735336465366533313130356636636434636534373962336637616530666137666135 +32616565373665316536313163386463646362336565396366373233376462303065353537613035 +37323637333537396239613936363833326535633466383934656465366538646564373634396338 +35353737633564336661616439313735626663326536666531383164303530353635326632343230 +37313236326639326639306465643366633030663163383165323930313634623762633164383432 +33653263376233386538323631343135383262616664356239663538346236333365616234393036 +64643235343338633533303935383931356561343663313634663836656464663031346663363863 +66633630373338383132343363653864323262386135343134376435343862363262613430616466 +65623839356234383362383331373534356532633235366231343538323331623661356163616639 +39306331623663623533386336356466333337376639313231646161373164313565323830616663 +62633931666137666462646663613962386562323264313833303561313262323232666263663331 +63616666356238633337356233653837376562656130356263303538346230306266313863393830 +30336366643762613164353164323165643733393334313134323662323239633133303636616265 +61336438333066323335656565326330663461626536653035393863613231363135643263666632 +63613461653961313936613035313933353231346432373738363561353632396139383234396432 +37323639663835323634323231306233656337353437373162366565396530363566383663306431 +39373765373335643837633236363135363038613533306235643937356464393063326436623463 +65323861636565623934393537366537376664346363643134396136643336376238633666373132 +31316330376565653531386666343038373562636566343266383665373866373862333131656539 +63373536323863666663353666653131346638396665616633353437326336343231303837383164 +65626237636634383661353637636230633163373461626536393938613462346331313635333131 +34646665653533643936363764623536623563336466386264616566306239313763303838313664 +39636438353166393038383862623764376534646638653534326539343766623361643230323762 +63333735633034326266393832643931633632396632383831376666326439616266383961353237 +64376534323234343962326161633230656264303763623737613136633734366661333632316134 +39366131353834653333636139393334646336616631623264653163343932666137393538316239 +64303139333535363431 diff --git a/roles/syncthing/files/os3/key.pem b/roles/syncthing/files/os3/key.pem new file mode 100644 index 0000000..587deae --- /dev/null +++ b/roles/syncthing/files/os3/key.pem @@ -0,0 +1,20 @@ +$ANSIBLE_VAULT;1.1;AES256 +35346439383133353933356233626365393230353664376566303363323130376338333236353337 +3336306236326233633635653933646266326466653163640a643062623932303861386536336361 +39626435636636353866316430383761353437653861383030653335613131656165643238656364 +3434313330613937390a386333633863326139383135363837643330653539376164626161336532 +36396330626633323466653032383765613136663861386165663039643637613566626332343033 +66356566373833633831343266336231353032646663366363386466323136303230383231656663 +63323263643931373731613163326561386266383464386330363265383831323034343435336532 +62363962656664376635623034653932396163333165346366353730356439393932383032323733 +33613637373534613163393433336263646239343430313665663830313834356531316261656439 +30666666303734366333346138613866666439353837623334306535333636626632313836303631 +63613464336563623837326137623337343031613462376437643239666364316230653031653039 +64666138353864383236633534666536303139636462376338646633623032636530343536323336 +34643632623538353963313038366562303634643766613865343330373562336665613334343335 +62313439396166326537383735323566646432393536366336633632663438386537353865646536 +30396430616539343364663630316435363635353632623836353061353765316462643963393134 +39393239646462383533613163313964323833306135303031363964383466383530393833386138 +31363531326133353438323836323936323636666264626238396639663939353661323235613562 +32356234353030303538653735336164643839323162613261396362376262346138346163613630 +613435313033633738313134333966383933 diff --git a/roles/syncthing/tasks/main.yml b/roles/syncthing/tasks/main.yml index 03c8e69..0c600d9 100644 --- a/roles/syncthing/tasks/main.yml +++ b/roles/syncthing/tasks/main.yml @@ -11,14 +11,16 @@ src: "{{ role_path }}/templates/config.xml.j2" dest: ~/.config/syncthing/config.xml register: config + vars: + profile: "{{ syncthing[syncthing_profile] }}" - name: Copy Syncthing private key copy: - src: "{{ role_path }}/files/key.pem" + src: "{{ role_path }}/files/{{ syncthing_profile }}/key.pem" dest: ~/.config/syncthing/key.pem register: private_key - name: Copy Syncthing certificate copy: - src: "{{ role_path }}/files/cert.pem" + src: "{{ role_path }}/files/{{ syncthing_profile }}/cert.pem" dest: ~/.config/syncthing/cert.pem register: certificate - name: Enable Syncthing diff --git a/roles/syncthing/templates/config.xml.j2 b/roles/syncthing/templates/config.xml.j2 index df33164..3163f68 100644 --- a/roles/syncthing/templates/config.xml.j2 +++ b/roles/syncthing/templates/config.xml.j2 @@ -1,12 +1,12 @@ - + {% for folder in profile.folders %} + basic - - - - + {% for device in folder.devices %} + + {% endfor %} 1 3600 @@ -43,105 +43,9 @@ 4096 - - basic - - - - - - - 1 - - 3600 - - basic - - 0 - 0 - 0 - random - false - 0 - 0 - 10 - false - false - false - 25 - .stfolder - false - 0 - 2 - false - standard - standard - false - false - false - false - false - false - - 1024 - 4096 - - - - basic - - - - - - - 1 - - 3600 - - basic - - 0 - 0 - 0 - random - false - 0 - 0 - 10 - false - false - false - 25 - .stfolder - false - 0 - 2 - false - standard - standard - false - false - false - false - false - false - - 1024 - 4096 - - - -
dynamic
- false - false - 0 - 0 - 0 - false - 0 -
- + {% endfor %} + {% for device in profile.devices %} +
dynamic
false false @@ -151,9 +55,10 @@ false 0
+ {% endfor %}
127.0.0.1:40465
- {{ syncthing.apikey }} + {{ profile.apikey }} default
@@ -178,7 +83,7 @@ 10 3 3 - {{ syncthing.usage_report_unique_id }} + {{ profile.usage_report_unique_id }} https://data.syncthing.net/newdata false 1800 @@ -211,7 +116,7 @@ basic - + 1 diff --git a/roles/syncthing/vars/main.yml b/roles/syncthing/vars/main.yml index ad5607f..8f9cef3 100644 --- a/roles/syncthing/vars/main.yml +++ b/roles/syncthing/vars/main.yml @@ -1,16 +1,77 @@ syncthing: - apikey: !vault | - $ANSIBLE_VAULT;1.1;AES256 - 63616464333437376436333362353263396536633733656431363563626364346536376331646531 - 3762666230663933633937303130356238343963323030320a643639353833616666316536326434 - 65333136656530353062303434633830343765613937386134303463323730666332353439343762 - 3230356330333565630a336239646134333364383165383662393735306566666662623237663164 - 35633538303738366538666466626666633431363134633963313739623231363065653936383131 - 6637636561393762323431303430353661396162393463646636 - usage_report_unique_id: !vault | - $ANSIBLE_VAULT;1.1;AES256 - 65636631303566326435306335663363393362613565326638666336353139376538343631663365 - 6666643239396464326438353438323033343334363731340a376638633564626563373866353132 - 30306363303664363233303533653232386264666432303537313630373636613061633237373930 - 6434346565383833300a316334663965353066633234636564653366326436663163363733616439 - 6666 + laptop: + apikey: !vault | + $ANSIBLE_VAULT;1.1;AES256 + 63616464333437376436333362353263396536633733656431363563626364346536376331646531 + 3762666230663933633937303130356238343963323030320a643639353833616666316536326434 + 65333136656530353062303434633830343765613937386134303463323730666332353439343762 + 3230356330333565630a336239646134333364383165383662393735306566666662623237663164 + 35633538303738366538666466626666633431363134633963313739623231363065653936383131 + 6637636561393762323431303430353661396162393463646636 + usage_report_unique_id: !vault | + $ANSIBLE_VAULT;1.1;AES256 + 65636631303566326435306335663363393362613565326638666336353139376538343631663365 + 6666643239396464326438353438323033343334363731340a376638633564626563373866353132 + 30306363303664363233303533653232386264666432303537313630373636613061633237373930 + 6434346565383833300a316334663965353066633234636564653366326436663163363733616439 + 6666 + folders: + - id: "6pgsm-opvsv" + label: "Sync" + path: "/home/{{ ansible_user_id }}/sync" + devices: + - "IGS4TYV-TQ6X2CG-OE3M2RE-DKZWKQZ-HEKIGHT-C6EIGHL-CBP2ULE-M3WZ7QC" + - "QW4NXKY-Y56F7ON-SIABMBI-EHMQANC-AVWEREO-B6WNTCN-NP2O7VI-6SGYMQS" + - id: "gfx9s-zaxrt" + label: "Music" + path: "/home/{{ ansible_user_id }}/Music" + devices: + - "IGS4TYV-TQ6X2CG-OE3M2RE-DKZWKQZ-HEKIGHT-C6EIGHL-CBP2ULE-M3WZ7QC" + - "QW4NXKY-Y56F7ON-SIABMBI-EHMQANC-AVWEREO-B6WNTCN-NP2O7VI-6SGYMQS" + - id: "tj35a-felne" + label: "Keepass" + path: "/home/{{ ansible_user_id }}/keepass" + devices: + - "IGS4TYV-TQ6X2CG-OE3M2RE-DKZWKQZ-HEKIGHT-C6EIGHL-CBP2ULE-M3WZ7QC" + - "QW4NXKY-Y56F7ON-SIABMBI-EHMQANC-AVWEREO-B6WNTCN-NP2O7VI-6SGYMQS" + - id: "sjpmp-qavt4" + label: "Uni" + path: "/home/{{ ansible_user_id }}/uni" + devices: + - "IGS4TYV-TQ6X2CG-OE3M2RE-DKZWKQZ-HEKIGHT-C6EIGHL-CBP2ULE-M3WZ7QC" + - "QW4NXKY-Y56F7ON-SIABMBI-EHMQANC-AVWEREO-B6WNTCN-NP2O7VI-6SGYMQS" + devices: + - name: "Server" + id: "IGS4TYV-TQ6X2CG-OE3M2RE-DKZWKQZ-HEKIGHT-C6EIGHL-CBP2ULE-M3WZ7QC" + - name: "Laptop" + id: "QW4NXKY-Y56F7ON-SIABMBI-EHMQANC-AVWEREO-B6WNTCN-NP2O7VI-6SGYMQS" + default_device_id: "QW4NXKY-Y56F7ON-SIABMBI-EHMQANC-AVWEREO-B6WNTCN-NP2O7VI-6SGYMQS" + os3: + apikey: !vault | + $ANSIBLE_VAULT;1.1;AES256 + 32653230666137343364326666663236393131613734366464386461373364376636346265306639 + 6434353439633730343936323536653138353565376232650a616363313339383162343336663234 + 39623465306630623338393637383232353236383164376636313236663065326661616166366138 + 3230333933653262640a623734666464636237383732323864353135633936656336366264313064 + 35396666373238323262363133393861653533396633653833653233373831616462663061393361 + 3630363063373638613632303234363637653133356162666366 + usage_report_unique_id: "" + folders: + - id: "sjpmp-qavt4" + label: "Uni" + path: "/home/{{ ansible_user_id }}/uni" + devices: + - "IGS4TYV-TQ6X2CG-OE3M2RE-DKZWKQZ-HEKIGHT-C6EIGHL-CBP2ULE-M3WZ7QC" + - "VL7HPMP-CKHKLPH-MHSN6PG-MFGKPYP-RBEMD3R-RLXT2ZI-KU36NKF-TRK5JAU" + - id: "tj35a-felne" + label: "Keepass" + path: "/home/{{ ansible_user_id }}/keepass" + devices: + - "IGS4TYV-TQ6X2CG-OE3M2RE-DKZWKQZ-HEKIGHT-C6EIGHL-CBP2ULE-M3WZ7QC" + - "VL7HPMP-CKHKLPH-MHSN6PG-MFGKPYP-RBEMD3R-RLXT2ZI-KU36NKF-TRK5JAU" + devices: + - name: "Server" + id: "IGS4TYV-TQ6X2CG-OE3M2RE-DKZWKQZ-HEKIGHT-C6EIGHL-CBP2ULE-M3WZ7QC" + - name: "OS3" + id: "VL7HPMP-CKHKLPH-MHSN6PG-MFGKPYP-RBEMD3R-RLXT2ZI-KU36NKF-TRK5JAU" + default_device_id: "VL7HPMP-CKHKLPH-MHSN6PG-MFGKPYP-RBEMD3R-RLXT2ZI-KU36NKF-TRK5JAU"