From efa9dfcbacfa24b306cd436b29bd3c841c6451b9 Mon Sep 17 00:00:00 2001 From: Maxim Vershinin Date: Tue, 7 Jul 2026 11:41:21 +0000 Subject: [PATCH] Directory structures and names changed to be follow the order of creation->provisioning->maintainance --- .../group_vars/all/secrets template.yaml | 4 +- inventory/group_vars/all/secrets.yaml | 63 ++++++++++--------- playbooks/deploy.yaml | 20 +++--- playbooks/maintain.yml | 2 +- .../files/.vimrc | 0 .../files/.zshrc | 0 .../files/hardened_ssh.conf | 0 .../files/hardened_sshd.conf | 0 .../files/install_omz.sh | 0 .../tasks/create_new_user.yaml | 0 .../tasks/harden_ssh.yaml | 0 .../tasks/install_basic_utils.yaml | 0 .../tasks/main.yaml | 0 .../tasks/prepare_ansible_user.yaml | 0 .../tasks/remove_packages.yml | 0 .../files/ca.pem | 0 .../tasks/main.yml | 0 17 files changed, 48 insertions(+), 41 deletions(-) rename roles/{0_basic_postinstall => 01_basic_postinstall}/files/.vimrc (100%) rename roles/{0_basic_postinstall => 01_basic_postinstall}/files/.zshrc (100%) rename roles/{0_basic_postinstall => 01_basic_postinstall}/files/hardened_ssh.conf (100%) rename roles/{0_basic_postinstall => 01_basic_postinstall}/files/hardened_sshd.conf (100%) rename roles/{0_basic_postinstall => 01_basic_postinstall}/files/install_omz.sh (100%) rename roles/{0_basic_postinstall => 01_basic_postinstall}/tasks/create_new_user.yaml (100%) rename roles/{0_basic_postinstall => 01_basic_postinstall}/tasks/harden_ssh.yaml (100%) rename roles/{0_basic_postinstall => 01_basic_postinstall}/tasks/install_basic_utils.yaml (100%) rename roles/{0_basic_postinstall => 01_basic_postinstall}/tasks/main.yaml (100%) rename roles/{0_basic_postinstall => 01_basic_postinstall}/tasks/prepare_ansible_user.yaml (100%) rename roles/{0_basic_postinstall => 01_basic_postinstall}/tasks/remove_packages.yml (100%) rename roles/{1_common_healthcheck => 02_common_healthcheck}/files/ca.pem (100%) rename roles/{1_common_healthcheck => 02_common_healthcheck}/tasks/main.yml (100%) diff --git a/inventory/group_vars/all/secrets template.yaml b/inventory/group_vars/all/secrets template.yaml index 1ae1423..a36dbc8 100644 --- a/inventory/group_vars/all/secrets template.yaml +++ b/inventory/group_vars/all/secrets template.yaml @@ -10,4 +10,6 @@ ntfy_topic: https://x.y.z/topic # ntfy topic token ntfy_topic_token: t0ken # Home Assistant Webhook token -ha_webhook_token: h@_t0ken \ No newline at end of file +ha_webhook_token: h@_t0ken +# Proxmox API token secret +proxmox_token_secret: t0ken_$ecret \ No newline at end of file diff --git a/inventory/group_vars/all/secrets.yaml b/inventory/group_vars/all/secrets.yaml index 76c6c81..d382ff1 100644 --- a/inventory/group_vars/all/secrets.yaml +++ b/inventory/group_vars/all/secrets.yaml @@ -1,30 +1,35 @@ $ANSIBLE_VAULT;1.1;AES256 -38616132653531633164316632376332616261393136373235356332646132663735646563653033 -3835343662356664633163366638383534383238623561350a313862376637383731663636663962 -36326233376135623338383631636364353864663965336335303632363263323733333238363436 -3939343938366361660a313933326563363638356531323162613039363662376537396631346230 -37666639323638613063646434663135373332316165336662396632363439363737383434383035 -39626232613439366166646465346231393330383266386234313633643132643530323361653735 -35326230396136616339376339636233336231316231303536666638623130323030616535646461 -61626466343136343532616261613635366534373138343333353732646664313864613732376562 -30376366613165336135313264373934313334316130613038393963653061343561383931343736 -34383739623831636539353165323062336365356633366131323236636434326666666238333962 -38643436386633353261373964633361316432633066323837383563383431633034663135366363 -38373463306565656164653134643232643532626661633263386436333134626435623563633933 -64343666363930333232353836666464656137666534643038343933366336393036656433336237 -63653933666566376462353132393337303064353361316434353466333239386634623063313836 -63363039376335306266666236626530346335353537626533326437336663633530396139323235 -33643331366330303862313864653566323430623866353434623735346135616165643535363662 -32633434386237336132663731353233663834616138353363343632613234643835386464376639 -36366433363766396361306261386439336561396633663630663764386565306531643664663239 -37373431656337346363333639333734623231393865613762666339356537313563333465626536 -34333535376362633235313535373331663961376365356661336635396239636461383663356361 -31353731356135396365663536336133303731653437623435666230386534373237323731316336 -37656261323530623564316438613735313138336236356630393737393663626461653936306564 -63626133343339343837626133343833323264633634623461366335336232316439613762366162 -64316638366434313636373265343230373934373034366130333737626137613935386637633832 -64616161633965373661626165393136323039383064383539613335363264613664346533346430 -33633732363362363563353034616637363962646166353335656265336463323537666665663566 -30353264623966373033656364636634643064613331383464643536366234363831366531363138 -31303232663633303462373461616662666564376233323637343630646331663465373537376132 -62616132363136306334336661656264336131393039346431363661663438396438 +37396233623362356239383039306566316433613761383032386566643964326638663830343837 +3031613035666339666634393439386463373734336130320a646331343036626234316131313265 +36666134646236333162316237326362333430616235633130633364666261343133306637623165 +6565633434353035390a323665636234616230373430663030666564363434623930656264343231 +39623465326661393832633661393437396535363434646261323737303163623230366161366163 +35373561636233313764366631373261316635386463353464306437323461613033313836383238 +36316133343737373666386534663939636234363831633738383738386433663533306465333230 +64633161396538316535346333343937306431386364363736656131613939336438663364323262 +34636633366464306231373739343764333935623434633331316463323961363364393865383732 +31393834626561643235393035666263646334613837666436333632393665346638623965346461 +35343966633631386330653834623234626537353739323938323339663836616139633832303465 +66356564636233663230633732333363343732396264653339396562353734643561643536616237 +34366536623535313533623634653632316538326137363034653030346337646264653765316662 +30613430636433303661353266666635333362613964383337643130316563633438653631373665 +37393465343561333966303137373636613937383261616365613463393263303863333134653630 +66386165303135343662346335653537366230316332666439326639613063383931313839376237 +64626362386666613362616666373565336666623837323064386262393135343834323161366163 +63393765653964633861663765343735626462303064383063643563393332653738343633313466 +61613264303139623530393765636162373136363837626134653930376230343463623433643063 +62393337623566616431306632333337616263633031613437643334363162623331653535396233 +63323939633563373137346537363834306261613738333636303762353639366136373734346632 +39333135616335343561626133386539333833366339613463626637326337333430376430393538 +33373234353064326435376432383139623561646361303063386531373164353335323265616566 +61643765313264626232366161313232323437306333316161663433643534363063393864666563 +35353966396164633534386663616233383236663466356465306361613039353366343630343063 +61643131343731366237313666626366656639663136393834376531323136653064383533383436 +31313038303766633339323465316236356536623362656432346233306434643236373831613339 +65663031326630303665306265623937623965633333363736373237333732306566386138396633 +36386461633762326466383436623263303935643133383365333664663665396134383730373030 +62663264363438336638663161366637663232383032633762373232396366633631666265323934 +62366536336435306539393662623962656335356439376466396539653263653033313964363364 +30303238646338396663323262653562353332346136323862616165663066373163313132396633 +31346438616130396332613736613635306530626663623634636434643137343262663635613061 +3762346665393865336666386163616430633731326237623733 diff --git a/playbooks/deploy.yaml b/playbooks/deploy.yaml index 1a29210..600b084 100644 --- a/playbooks/deploy.yaml +++ b/playbooks/deploy.yaml @@ -5,16 +5,16 @@ roles: - ../roles/00_basic_proxmox_lxc -#- name: Basic Proxmox guest deployment -# hosts: all -# remote_user: root -# roles: -# - ../roles/01_basic_postinstall -# vars_files: -# ../inventory/group_vars/all/secrets.yaml -# vars: -# ansible_user_passwd_hash: "{{ ansible_password | password_hash('sha512', 's3edscrj45e6r') }}" -# user_passwd_hash: "{{ user_password | password_hash('sha512', 's3ed6123jhgcr') }}" +- name: Basic Proxmox guest deployment + hosts: all + remote_user: root + roles: + - ../roles/01_basic_postinstall + vars_files: + ../inventory/group_vars/all/secrets.yaml + vars: + ansible_user_passwd_hash: "{{ ansible_password | password_hash('sha512', 's3edscrj45e6r') }}" + user_passwd_hash: "{{ user_password | password_hash('sha512', 's3ed6123jhgcr') }}" handlers: - name: restart sshd diff --git a/playbooks/maintain.yml b/playbooks/maintain.yml index 7e0714d..8d0afa3 100644 --- a/playbooks/maintain.yml +++ b/playbooks/maintain.yml @@ -3,7 +3,7 @@ hosts: all remote_user: ansible roles: - - ../roles/1_common_healthcheck + - ../roles/02_common_healthcheck vars_files: ../inventory/group_vars/all/secrets.yaml vars: diff --git a/roles/0_basic_postinstall/files/.vimrc b/roles/01_basic_postinstall/files/.vimrc similarity index 100% rename from roles/0_basic_postinstall/files/.vimrc rename to roles/01_basic_postinstall/files/.vimrc diff --git a/roles/0_basic_postinstall/files/.zshrc b/roles/01_basic_postinstall/files/.zshrc similarity index 100% rename from roles/0_basic_postinstall/files/.zshrc rename to roles/01_basic_postinstall/files/.zshrc diff --git a/roles/0_basic_postinstall/files/hardened_ssh.conf b/roles/01_basic_postinstall/files/hardened_ssh.conf similarity index 100% rename from roles/0_basic_postinstall/files/hardened_ssh.conf rename to roles/01_basic_postinstall/files/hardened_ssh.conf diff --git a/roles/0_basic_postinstall/files/hardened_sshd.conf b/roles/01_basic_postinstall/files/hardened_sshd.conf similarity index 100% rename from roles/0_basic_postinstall/files/hardened_sshd.conf rename to roles/01_basic_postinstall/files/hardened_sshd.conf diff --git a/roles/0_basic_postinstall/files/install_omz.sh b/roles/01_basic_postinstall/files/install_omz.sh similarity index 100% rename from roles/0_basic_postinstall/files/install_omz.sh rename to roles/01_basic_postinstall/files/install_omz.sh diff --git a/roles/0_basic_postinstall/tasks/create_new_user.yaml b/roles/01_basic_postinstall/tasks/create_new_user.yaml similarity index 100% rename from roles/0_basic_postinstall/tasks/create_new_user.yaml rename to roles/01_basic_postinstall/tasks/create_new_user.yaml diff --git a/roles/0_basic_postinstall/tasks/harden_ssh.yaml b/roles/01_basic_postinstall/tasks/harden_ssh.yaml similarity index 100% rename from roles/0_basic_postinstall/tasks/harden_ssh.yaml rename to roles/01_basic_postinstall/tasks/harden_ssh.yaml diff --git a/roles/0_basic_postinstall/tasks/install_basic_utils.yaml b/roles/01_basic_postinstall/tasks/install_basic_utils.yaml similarity index 100% rename from roles/0_basic_postinstall/tasks/install_basic_utils.yaml rename to roles/01_basic_postinstall/tasks/install_basic_utils.yaml diff --git a/roles/0_basic_postinstall/tasks/main.yaml b/roles/01_basic_postinstall/tasks/main.yaml similarity index 100% rename from roles/0_basic_postinstall/tasks/main.yaml rename to roles/01_basic_postinstall/tasks/main.yaml diff --git a/roles/0_basic_postinstall/tasks/prepare_ansible_user.yaml b/roles/01_basic_postinstall/tasks/prepare_ansible_user.yaml similarity index 100% rename from roles/0_basic_postinstall/tasks/prepare_ansible_user.yaml rename to roles/01_basic_postinstall/tasks/prepare_ansible_user.yaml diff --git a/roles/0_basic_postinstall/tasks/remove_packages.yml b/roles/01_basic_postinstall/tasks/remove_packages.yml similarity index 100% rename from roles/0_basic_postinstall/tasks/remove_packages.yml rename to roles/01_basic_postinstall/tasks/remove_packages.yml diff --git a/roles/1_common_healthcheck/files/ca.pem b/roles/02_common_healthcheck/files/ca.pem similarity index 100% rename from roles/1_common_healthcheck/files/ca.pem rename to roles/02_common_healthcheck/files/ca.pem diff --git a/roles/1_common_healthcheck/tasks/main.yml b/roles/02_common_healthcheck/tasks/main.yml similarity index 100% rename from roles/1_common_healthcheck/tasks/main.yml rename to roles/02_common_healthcheck/tasks/main.yml