diff --git a/README.md b/README.md index ce1b2bc..76a5c41 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ - [x] davfs mount - [x] VM server - + - [x] syncthing role ### Workstation roles @@ -78,29 +78,26 @@ - [x] failtoban role -- [ ] nginx/php role +- [x] nginx/php role - install - config -- [ ] dns role +- [x] dns role -slave/primary -- [ ] mariadb role +- [x] mariadb role - install - config - - backup + - (voir pouquoi l'init de mysql ne fonctionne pas dans ansible) -- [ ] tt-rss role +- [x] tt-rss role - depend nginx & madiadb role - fail2ban jail -- [ ] gitea role +- [x] gitea role - depend of mariadb role -- [ ] dns role - -slave/primary - - [ ] backup role? - controle du reboot diff --git a/chainetv.yml b/chainetv.yml new file mode 100644 index 0000000..8a3f374 --- /dev/null +++ b/chainetv.yml @@ -0,0 +1,8 @@ +--- +- hosts: server + vars: + force_site_update: true + + roles: + - chainetv + diff --git a/group_vars/all/all_vault b/group_vars/all/all_vault index bda2981..0984003 100644 --- a/group_vars/all/all_vault +++ b/group_vars/all/all_vault @@ -1,10 +1,19 @@ $ANSIBLE_VAULT;1.1;AES256 -36336139353839303537376234623535363838613761633137633166636261353862643935393563 -6363356531376261333364306238343961343435336637380a623134636661326262623635326266 -62623433343939353866373365343966656533376230323835313131326130326265316364336537 -6332306265643336630a326530656536373662613636353735666164326461333232363534316564 -36643333636464663734666364366436366235326136313134393965626636643034396662383261 -34363236653530326635303239643166313966363062333534616332383736626430346633396438 -61353964643930353731316664393534356366373563326337303964323366333733386134646337 -31303736383735366662323637336635656161376337313563386438376136653365656433663336 -3530 +66373932613336323337303165393131656639616164393765646533343937346638343235623665 +3764663835643766636165386231633538323730303865350a373730356638316331643332386236 +65346662623063613933663233376239333664396431333264366464386632333936653130353431 +6538366132316333310a393537373862363439346565613566636330613934363136373131353161 +30313339343332396132666234646130666661356236333937343730386539656562343538656265 +35366237646264393466353835383439616264623737366230303833353033616163326635396539 +62363761313663326131363334323761336531353564323565373132393134383664353061396166 +65396530313165353164636239383038316137616437333962613662653535343938646637336233 +31393162623762643038323139313464393965613539353331646134653463306137653661303539 +31356235656231303261306465393836326362343262613134373566393035396165313235623265 +37333162313535653838353633626665623030663663386362663037323230393438333832376238 +31383734653733636337616639323161316535363636663236346234323833303662346230626565 +65633730363937646237643035366535393063653962346536616361666232336466663233313063 +64363864336237343739653065663730353031363130396134393337346465396164386161303938 +61303334323939616437313763663164323937386266666530373732613962366130326435613563 +62326332646561363365376363616431623330373561623761383336303835323765383831353064 +32643235316130333039616538326533636466346439616261616139326262396631386239653138 +6165613133656637633766643434376566393134643731343534 diff --git a/group_vars/server b/group_vars/server index e3a7e32..ff2c313 100644 --- a/group_vars/server +++ b/group_vars/server @@ -14,10 +14,26 @@ systemd_mounts: - uid=1024 - guid=100 automount: true - + diskstation_music: + share: //diskstation.ducamps.win/music + mount: /mnt/diskstation/music + type: cifs + options: + - credentials=/etc/creds/.diskstation_credentials + - uid=1024 + - gid=100 + automount: true systemd_mounts_enabled: - diskstation_git - - backup_disk + - diskstation_music + - backup_disk + +credentials_files: + 1: + type: smb + path: /etc/creds/.diskstation_credentials + username: admin + password: "{{ vault_default_password }}" syncthing_address: "{{inventory_hostname}}:8384" syncthing_gui_user: "{{user.name}}" @@ -59,15 +75,15 @@ nginx_vhosts: location = /50x.html { root /usr/share/nginx/html; } - - location =/ { - rewrite ^ /starter; - } - location / { + location / { index index.php index.html index.htm ; default_type text/html; } + location =/ { + rewrite ^ /starter; + } + location ~ \.php$ { # try_files $uri =404; fastcgi_split_path_info ^(.+\.php)(/.+)$; @@ -77,6 +93,7 @@ nginx_vhosts: fastcgi_index index.php; include fastcgi_params; } + include /etc/nginx/conf.d/*.default; nginx_realIP_Proxy: 192.168.1.10/24 @@ -85,4 +102,47 @@ php_extention_enable: - iconv - mysqli - pdo_mysql - - soap \ No newline at end of file + - soap + +mysql_root_password: "{{ vault_mysql_root }}" +mysql_root_password_update: true + + +# Users. +mysql_users: + - name: dump + host: localhost + password: "{{ vault_mysql_dump }}" + priv: "*.*:SELECT,SHOW DATABASES,LOCK TABLES" + +ttrss_db_password: "{{ vault_mysql_ttrss }}" +ttrss_log_destination: "" +ttrss_SQl_target_file: /mnt/diskstation/git/backup/mysql/last/ttrss.sql + +bind_listen_ipv4: ['any'] +bind_allow_query: ['any'] +bind_zone_master_server_ip: 192.168.1.10 +bind_zone_domains: + - name: ducamps.win + hostmaster_email: "vincent@ducamps.win" + - name: 1.168.192.in-addr.arpa + hostmaster_email: "vincent@ducamps.win" +bind_forwarders: + - '1.1.1.1' + - '80.67.169.40' +bind_recursion: true +bind_allow_recursion: + - "192.168.1.0/24" + +gitea_http_listen: 0.0.0.0 +gitea_db_type: mysql +gitea_db_host: localhost:3306 +gitea_db_name: gitea +gitea_db_user: gitea +gitea_db_password: "{{ vault_mysql_gitea }}" +gitea_ssh_domain: "{{ansible_hostname}}" +gitea_start_ssh: false +gitea_ssh_port: 22 +gitea_SQl_target_file: /mnt/diskstation/git/backup/mysql/last/gitea.sql + +supysonic_db_password: "{{ vault_mysql_supysonic }}" \ No newline at end of file diff --git a/host_vars/arch3 b/host_vars/arch3 new file mode 100644 index 0000000..4931a29 --- /dev/null +++ b/host_vars/arch3 @@ -0,0 +1,6 @@ +ttrss_url_path: http://arch3/tt-rss/ + +gitea_http_domain: arch3 +gitea_root_url: http://arch3:3000 + +chainetv_repo_branch: dev \ No newline at end of file diff --git a/host_vars/nas b/host_vars/nas index 17c2657..52c9633 100644 --- a/host_vars/nas +++ b/host_vars/nas @@ -1,2 +1,8 @@ ##ansible_python_interpreter: /usr/bin/python2 ##music_directory: '/mnt/diskstation/music' +ttrss_url_path: http://nas/tt-rss/ + +gitea_http_domain: nas +gitea_root_url: http://nas:3000 + +chainetv_repo_branch: dev \ No newline at end of file diff --git a/host_vars/pi2 b/host_vars/pi2 index e69de29..f7aaaea 100644 --- a/host_vars/pi2 +++ b/host_vars/pi2 @@ -0,0 +1,3 @@ +ttrss_url_path: "https://www.{{domain.name}}/tt-rss" +gitea_http_domain: git.{{domain.name}} +gitea_root_url: https://git.{{domain.name}} \ No newline at end of file diff --git a/server.yml b/server.yml index 5a75d8f..5b45bc2 100644 --- a/server.yml +++ b/server.yml @@ -9,15 +9,17 @@ become: yes roles: + - user_config - ssmtp - cronie - rsyncd - gandi-dyn-dns - fail2ban - - dns + - {role: dns , become: yes } - {role: nginx, become: yes } + - {role: mariadb, become: yes } - php - tt-rss - gitea - - user_config + - chainetv diff --git a/staging b/staging index 890b7a2..fc2b473 100644 --- a/staging +++ b/staging @@ -8,5 +8,5 @@ arch2 [server] nas - +arch3 diff --git a/supysonic.yml b/supysonic.yml new file mode 100644 index 0000000..bd56c72 --- /dev/null +++ b/supysonic.yml @@ -0,0 +1,8 @@ +--- +- hosts: server + vars: + force_site_update: true + + roles: + - supysonic +