Procházet zdrojové kódy

[miniflux][podgrab] Add a few new apps

Colin Powell před 4 roky
rodič
revize
ad868fcf4c

+ 78 - 31
ansible/group_vars/jails

@@ -1,31 +1,78 @@
----
-services_unblink_email_pass: defuse-immovably-washing-pesky
-
-postgres_db_pass: sulfide brisket qualified fleshed
-pbp_db_pass: jackknife extent these reword
-fifteenfive_db_pass: ebony subfloor shining resolute
-gogs_db_pass: chaste whimsical tartness underpaid
-synapse_db_pass: c'Gt'[H}&|vH}wW,k&#i+@h*6
-
-gogs_secret_key: ZKytD1R4WUaCtJo
-
-morty_secret_key: f4ea81d8dcf92569047b35da554c781b
-searx_secret_key: 9823ljasd0fj20jlxdzl;kjsdf
-
-fifteenfive_secret_key: 039asdfl91.sdfj1jmk01pksdfjlkjglasdk3nmv
-fifteenfive_okta_key: 00hefB8-iQb5r87VCVwJBs95LfVv_7RxtDkH-UbjEc
-fifteenfive_okta_cert:
-fifteenfive_azure_cert:
-fifteenfive_bamboohr_api_key: 4e9a71282f45ec66f9b2c0cfb4af3c3b3c4de5cd
-fifteenfive_bamboohr_app_key: b3aff42801e18debf303c2eae6cfceb71661a9aa
-fifteenfive_bamboohr_client_secret: b3aff42801e18debf303c2eae6cfceb71661a9aa
-fifteenfive_namely_oauth_client_secret: 1xTZ3oOFUBaCnjWuemthX4hwgn8qRQD9XDuchdUcYe2mDf0jBAWTXenZ8FxuEZMo
-fifteenfive_recurly_api_key: 237ba24f90c649f9802fcb9aaba0dc80
-
-colin_unblink_email_pass: distrust_nastily_clumsily_passivism
-colin_castine_email_pass: politely_awaken_frustrate_grime
-secstate_sdf_email_pass: pagan change removable brigade thesis
-colin_powell_15five_email_pass: ndohgglhczgqfbre
-
-synapse_reg_shared_secret: dFXbmE-FBHYp@g.yph,GC5h5d#,6YAW=ofb~,^ZzrukgIa@yk*
-synapse_signing_key: ed25519 a_nxhf 3OP64xzBYTXpB3WDh9TgvkIcCKgotDQ0Hs2Z0JY+NUo
+$ANSIBLE_VAULT;1.1;AES256
+38343366346338353530396239373536643338383238373666323664633534653035356166376430
+3238633664623635353535643463333964613235393538610a656331393931346361383030343036
+34626135383365356333313835323534613131333261393331306435313637636132636633386534
+6366343461383966320a313134336638363563386261343836666533316662653736336364393231
+62313632633630646264363838613265616130353638396637343262636565353763313765343836
+39373638643162396136613230333033613130666331383934316633313764626133653932346636
+38656466343661373136643762373533303163643363636263333165323633383632663266643634
+39396462393264393330353035626436353662303561633965386638336437633866633662636130
+34343037326433653935353936356237623261646366326631346434366631363133393230616165
+62313564613464396330373039353739643632343261343662323930343130643935626436393835
+65373132376462363538643361643936376466353066373138353839666536663531336263323061
+63623365613738313338626666393631343065356139313930333030626235366234323965323932
+63326430313934363833363164353534656137363133373062643230623364616564383036363865
+65393530386339396661613461666466353032306263313934333434636630396664623561346636
+31306363643930646166303861613339636165666562313162633035303737343765316139386234
+32373134303161663134303133613535653765656566383361323933383636306337396430613638
+63343138376234663564656538343731373231633565616530363336303331366262623436346264
+39393138333631653530643533333633376365306331366264323764396335376538343932626533
+33356465656362383939646139393533323433623633393930383364313064666637666465393163
+65663531313161343064643230333530343862373432323537366430373239343665333664633831
+33313830383065646164333631636433616533336334373065396361376166653561363562323363
+62653630346439363937393262623131663861363761356639376465663132386539653161646139
+61333764316539303234633030393738333333393832343363353031303662356637643235353234
+35393236646636663233666633623638383236316233396230663731306464323935396366323833
+33323830336638646637643365323462313333326362363263336631313762356463363662623765
+66343566633435613738326361356332386165326435316431636430353739356332313431656261
+62396136636438313764643861633762393435386462663465633861356131663839663063376565
+63643362313864353639636336613832633866383939623133383966356138356638663439343662
+63353261623837333461386635666631643631336164383861633861373061366435613834633731
+39613030346664383966333234656365396663393765346362383165613637343963633731396436
+37663765393230643434353633363534363930616639356664623032623662353930306233633136
+31616666306463346335653965323139326238343532653637396237623162366137623031613731
+30343638393839646138373535363965336465396432616237663365323937393934613366366534
+31356231623666643162386632386533636430623034633964343736326464613630653165666637
+30343732616462313039623865363364643462303034303364383466306131653664363336306531
+61613666383131383565356264323762343564373732383638313032643139303638626666646162
+30376139373131616361306661666539616137336137663163393638353233666163373662343139
+63633466396437326333303661343639666636343930323462373666656233363937306565353736
+66356139316163366331656263346437656132383964623738623363333137326532386635653462
+65306334616466396430346133366665636366633234626130653239613831306232623366633534
+62343163633034653964623234396461626431346439383830373364616436616231303234326139
+30323639613265663663356534306230633034393263623163346433353563626561376634356364
+62373637386438323838363930396639323961383636336332396363313362396233663363636332
+33313239383861666663376238643238366331633065326262323539626536393962633036356333
+63616361653565313365316339326534626638663863346536343034313166323265353435316333
+36643736313561393236383535633664393866353434653961363838613739656665336263646631
+33383030353839353763333164333366646132366631316162653036643163653663336262643965
+63636236363366323930626561633730643935663139633262303766313533373434613734393265
+66363064346134313535323030636464636433323339633865636233353839613630646432646133
+36306230373338383261353866346637613237386463383830643364326137333731396230313263
+34663936316439633631633832366562343064636366333662346165383134353230346466646561
+33333431363762303163393033376135343036623732383430333163353732303562363866663735
+65383236643139383339376264373232643963396166633733666261313234663162643932306538
+35623033376632343830656539303031616463313433306337633633383731623031376437633039
+31343835653862643361363135396566383063393135313366373566653861306662666630363939
+64663435663338656135343263386661353161386338323734363334666438396663383034643861
+37316634373030653437613633363032343362643836333931356330363037306538316664383464
+38363364343538393165663630663364616362383361306361636134636635613435383435313766
+62316637356139386534363861333331626138316563623338313736373765613730633862396530
+65366230303736373966316633643965343334386535323539623166316331623363616435313863
+38613134626138623936333538303238396538313736643366313636626235396634346431636661
+31373733393333343731666531393165383231383035653333343564656338353339656665333932
+30356464633965613063333466343937353537333862373764626236313764313835396462353261
+65383832336338636137303561353663376239376133613435333963633636366330626665643364
+32323134313962636634386662663732623434623061636666326235303265656263656338316435
+32646638336266356163393365383538363463323737383631303364643263353734663131313063
+37366139663064346333313133316539323937343335303030376235383064393738323930313666
+32616337346139663264306334656232393665393331373633343362353438363438393835303337
+33346238653664353464333333396364643631326434396161336639643731363338623434303231
+33613135663064626365663431663933316238613334383438383230383663616334326233333434
+65656537653834313563333238366236313632313438303665616536376264316333343631653530
+37633331633537663538333930373932303462306530393636353137343162643462396337346165
+37633461323830623833313838373332326362336662333135666363383835356630626631333262
+37663665376435343134316436333330643236323366646536396334653731613731653034383161
+36373965633930313063623062303634396230396630346639393563356138323038613833376665
+30353433373161396639386431393833626332343463313136626134373464396666366437616437
+6538

+ 65 - 52
ansible/hosts

@@ -1,12 +1,3 @@
-[physical]
-pandora.unbl.ink
-phoebe.local
-titan.local
-prometheus.local
-dione.local
-janus.local
-rhea.local
-
 [jails]
 bastion.local ansible_become=true
 search.local
@@ -18,48 +9,73 @@ chat.local
 logs.local
 dev-pbp.local
 dev-ff.local
-dev-ff2.local
 dev-mail.local
 tor.local
 videos.local
-wx.local
+weewx.local
 books.local
 photos.local
-192.168.1.229
-192.168.1.165
-192.168.1.170
-192.168.1.185
-192.168.1.233
+podcasts.local
 
-[vms]
-mopidy.local
+[bhyve]
+mopidy.local ansible_become=true
+jellyfin.local ansible_become=true
 
-[cloud]
+[physical]
+rhea.local ansible_become=true
+phoebe.local ansible_become=true
+titan.local ansible_become=true
+iapetus.local ansible_become=true
+prometheus.local ansible_become=true
+dione.local ansible_become=true
+paaliaq.local ansible_become=true
+kiviuq.local ansible_become=true
+
+[hosted]
 box.unbl.ink
 box.castine.town
+pandora.unbl.ink
 
 [ubuntu]
-mopidy.local
+mopidy.local ansible_become=true
+jellyfin.local ansible_become=true
 box.unbl.ink
 box.castine.town
+pandora.unbl.ink
 
 [freebsd]
+paaliaq.local ansible_become=true
+kiviuq.local ansible_become=true
+bastion.local ansible_become=true
+search.local
+db.local
 mail.local
+rss.local
 git.local
-bastion.local
-logs.local
 chat.local
-pbp.local
-search.local
-tor.local
-rss.local
+logs.local
+dev-pbp.local
 dev-ff.local
-dev-ffexp.local
-dev-ff2.local
+dev-mail.local
+tor.local
+videos.local
+weewx.local
+books.local
+photos.local
+podcasts.local
+
+[mailinabox]
+box.unbl.ink
+box.castine.town
+
+[torrent]
+pandora.unbl.ink
+
+[media]
+jellyfin.local ansible_become=true
 
 [mail]
-mail.local
-192.168.1.170
+mbsync.local
 
 [box]
 box.unbl.ink
@@ -67,15 +83,13 @@ box.castine.town
 
 [dns]
 unbound.local
-192.168.1.229
 
 [webapps]
 dev-pbp.local
 dev-ff.local
 
 [gogs]
-git.local
-192.168.1.170
+gogs.local
 
 [jump]
 bastion.local
@@ -83,19 +97,18 @@ bastion.local
 [proxy]
 bastion.local
 
-[chat]
-chat.local
-192.168.1.233
+[matrix]
+matrix.local
+testmatrix.local
 
-[grafana]
-logs.local
+[logging]
+grafana.local
 
-[searx]
-search.local
-192.168.1.165
+[search]
+searx.local
 
-[ttrss]
-rss.local
+[rss]
+miniflux.local
 
 [tor]
 tor.local
@@ -105,22 +118,22 @@ dev-pbp.local
 
 [fifteen5]
 dev-ff.local
-dev-ffexp.local
-dev-ff2.local
 
 [db]
-db.local
+postgres.local
 
 [dev-mail]
-dev-mail.local
+mailhog.local
 
 [weather]
 wx.local
-192.168.1.185
-kiviuq.local
+kiviuq.local ansible_become=true
 
-[calibre]
-books.local
+[books]
+calibre.local
 
 [photos]
-photos.local
+photoview.local
+
+[podcasts]
+podcasts.local

+ 5 - 1
ansible/playbook.yml

@@ -52,6 +52,10 @@
   roles:
     - role: muchsync
 
-- hosts: chat
+- hosts: matrix
   roles:
     - role: matrix
+
+- hosts: podcasts
+  roles:
+    - role: podgrab

+ 8 - 0
ansible/roles/miniflux/files/supervisord.conf.patch

@@ -0,0 +1,8 @@
+@@ -125,5 +125,5 @@
+ ; interpreted as relative to this file.  Included files *cannot*
+ ; include files themselves.
+
+-;[include]
+-;files = relative/directory/*.ini
++[include]
++files = supervisor/conf.d/*.conf

+ 5 - 0
ansible/roles/miniflux/handlers/main.yml

@@ -0,0 +1,5 @@
+---
+- name: Supervisor restarted
+  service:
+    name: supervisord
+    state: restarted

+ 27 - 0
ansible/roles/miniflux/tasks/main.yml

@@ -0,0 +1,27 @@
+---
+- name: Package cache updated
+  shell: pkg update -f
+
+- name: Dependencies installed
+  pkgng:
+    name: "py37-supervisor"
+    state: present
+
+- name: Miniflux downloaded
+  shell: fetch https://github.com/miniflux/v2/releases/download/2.0.28/miniflux-freebsd-amd64 -o /usr/local/bin/miniflux
+
+- name: Supervisord enabled
+  shell: sysrc supervisord_enable="YES"
+
+- name: Supervisor config file patched
+  patch:
+    src: supervisord.conf.patch
+    dest: /usr/local/etc/supervisord.conf
+
+- name: WeeWX supervisor file installed
+  template:
+    src: miniflux-supervisor.conf.j2
+    dest: /usr/local/etc/supervisor/conf.d/miniflux.conf
+    owner: root
+    mode: 0644
+  notify: Supervisor restarted

+ 8 - 0
ansible/roles/miniflux/templates/miniflux-supervisor.conf.j2

@@ -0,0 +1,8 @@
+[program:miniflux]
+environment=DATABASE_URL='postgres://miniflux:{{miniflux_db_pass}}@db.local/miniflux?sslmode=disable'
+command=/usr/local/bin/miniflux
+autostart=true
+autorestart=true
+stdout_logfile=/var/log/miniflux.log
+stderr_logfile=/var/log/miniflux.err.log
+stopsignal=QUIT

+ 8 - 0
ansible/roles/podgrab/files/supervisor.conf

@@ -0,0 +1,8 @@
+[program:podgrab]
+directory=/usr/local/src/podgrab
+command=/usr/local/src/podgrab/podgrab
+autostart=true
+autorestart=true
+stdout_logfile=/var/log/podgrab.log
+stderr_logfile=/var/log/podgrab.err.log
+stopsignal=QUIT

+ 8 - 0
ansible/roles/podgrab/files/supervisord.conf.patch

@@ -0,0 +1,8 @@
+@@ -125,5 +125,5 @@
+ ; interpreted as relative to this file.  Included files *cannot*
+ ; include files themselves.
+
+-;[include]
+-;files = relative/directory/*.ini
++[include]
++files = supervisor/conf.d/*.conf

+ 5 - 0
ansible/roles/podgrab/handlers/main.yml

@@ -0,0 +1,5 @@
+---
+- name: Supervisor restarted
+  service:
+    name: supervisord
+    state: restarted

+ 44 - 0
ansible/roles/podgrab/tasks/main.yml

@@ -0,0 +1,44 @@
+---
+- name: Package cache updated
+  shell: pkg update -f
+
+- name: Dependencies installed
+  pkgng:
+    name: "git go py37-supervisor"
+    state: present
+
+- name: Source folder exists
+  file:
+    path: /usr/local/src
+    owner: root
+    mode: 0755
+    state: directory
+
+- name: Podgrab source deployed
+  git:
+    repo: "https://github.com/akhilrex/podgrab.git"
+    dest: /usr/local/src/podgrab
+    accept_hostkey: yes
+    update: yes
+
+- name: Build podgrab binary
+  shell:
+    chdir: /usr/local/src/podgrab
+    cmd: go build .
+
+- name: Supervisor enabled
+  shell: sysrc supervisord_enable="YES"
+
+- name: Supervisor config file patched
+  patch:
+    src: supervisord.conf.patch
+    dest: /usr/local/etc/supervisord.conf
+  notify: Supervisor restarted
+
+- name: Supervisor file installed
+  copy:
+    src: supervisor.conf
+    dest: /usr/local/etc/supervisor/conf.d/podgrab.conf
+    owner: root
+    mode: 0644
+  notify: Supervisor restarted