run config/update_files.sh

This commit is contained in:
Dmitry Belyaev 2023-05-16 23:49:06 +03:00
parent 1c9c22477c
commit de0fa9eb69

View File

@ -15,57 +15,55 @@ autoinstall:
debconf-selections: | debconf-selections: |
ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true
packages: packages:
- openssh-server - openssh-server
- openssh-client - openssh-client
- mosh - mosh
- mc - mc
- htop - htop
- ca-certificates - ca-certificates
- curl - curl
- wget - wget
- apt-transport-https - apt-transport-https
- apt-utils - apt-utils
- locales-all - locales-all
- language-pack-ru - language-pack-ru
- language-pack-ru-base - language-pack-ru-base
- unixodbc - unixodbc
- libfreetype6 - libfreetype6
- fontconfig - fontconfig
- t1utils - t1utils
- apache2 - apache2
- nginx - nginx
- unzip - unzip
- libc6-i386 - libc6-i386
- git - git
- build-essential - build-essential
- python-is-python3 - python-is-python3
- python3-pip - python3-pip
- python3-virtualenv - python3-virtualenv
- dkms - dkms
- samba - samba
- fusesmb - fusesmb
- samba-vfs-modules - samba-vfs-modules
- cifs-utils - cifs-utils
- avahi-daemon - avahi-daemon
- avahi-dnsconfd - avahi-dnsconfd
- libnss-winbind - libnss-winbind
- libnss-mdns - libnss-mdns
- cups - cups
- wsdd - wsdd
- libxt6 - libxt6
- libtcmalloc-minimal4 - libtcmalloc-minimal4
late-commands: late-commands:
- stat /cdrom/1c/install >/dev/null 2>/dev/null && sh -exc "mkdir -p /target/var/install/1c && cp /cdrom/1c/install/* /target/var/install/1c/" || echo skip 1c distr copy - stat /cdrom/1c/install >/dev/null 2>/dev/null && sh -exc "mkdir -p /target/var/install/1c && cp /cdrom/1c/install/* /target/var/install/1c/" || echo skip 1c distr copy
- sync - sync
- echo --- done! --- - echo --- done! ---
user-data: user-data:
hostname: srv1c hostname: srv1c
groups: groups:
- postgres - postgres
- grp1cv8 - grp1cv8
- www-data - www-data
users: users:
- default - default
- name: admin1c - name: admin1c
@ -78,23 +76,20 @@ autoinstall:
passwd: $6$rounds=4096$X0PCsEEYkoirzYwF$vFfmCzOhzPQUsdXbrlt0cyX0wEiuRc2WecIUMyO2ZkTYzSh8oz2Sp87OFVxCHp0sPklRDmdwkK56EZCar.N1o/ passwd: $6$rounds=4096$X0PCsEEYkoirzYwF$vFfmCzOhzPQUsdXbrlt0cyX0wEiuRc2WecIUMyO2ZkTYzSh8oz2Sp87OFVxCHp0sPklRDmdwkK56EZCar.N1o/
ssh_import_id: ssh_import_id:
- gh:b4tman - gh:b4tman
#ssh_authorized_keys: #ssh_authorized_keys:
# - <ssh pub key 1> # - <ssh pub key 1>
- name: postgres - name: postgres
primary_group: postgres primary_group: postgres
groups: grp1cv8 groups: grp1cv8
system: true system: true
passwd: $6$rounds=4096$7HbuIwc5Gbm.$eDOOBbMBh9teE82CE9MGJXJuK3nRuJpjIbkUqOmPN7FyH/Nj.3bgDosdM1WoztBXHYwgCyd1dhya/5aR36Njm1 passwd: $6$rounds=4096$7HbuIwc5Gbm.$eDOOBbMBh9teE82CE9MGJXJuK3nRuJpjIbkUqOmPN7FyH/Nj.3bgDosdM1WoztBXHYwgCyd1dhya/5aR36Njm1
locale: "ru_RU.UTF-8" locale: "ru_RU.UTF-8"
timezone: Europe/Moscow timezone: Europe/Moscow
ntp: ntp:
enabled: true enabled: true
ntp_client: auto ntp_client: auto
package_update: true package_update: true
package_upgrade: true package_upgrade: true
write_files: write_files:
- path: /etc/systemd/system/srv1cv83@.service - path: /etc/systemd/system/srv1cv83@.service
encoding: gzip+base64 encoding: gzip+base64
@ -116,7 +111,6 @@ autoinstall:
ZWjWpJOSN22e1T1B0sm737v37Jl0/JK+SN0ColTD6pWiXk6n8xu5o3E790x+BB1sPS7ZjqqaYxcF ZWjWpJOSN22e1T1B0sm737v37Jl0/JK+SN0ColTD6pWiXk6n8xu5o3E790x+BB1sPS7ZjqqaYxcF
d39SjclOrBfGa5OkpvmVTc3Y8272bh6f3+CXxPgOMPHItqZ5xZ2n/WCi+QZPbpIXVCr8towrCtyH d39SjclOrBfGa5OkpvmVTc3Y8272bh6f3+CXxPgOMPHItqZ5xZ2n/WCi+QZPbpIXVCr8towrCtyH
yrPp32UKFA+EdjftO0MGs7MtzVHLO261my/TH0B8qt7jBgAA yrPp32UKFA+EdjftO0MGs7MtzVHLO261my/TH0B8qt7jBgAA
- path: /etc/systemd/system/srv1cv83-ras@.service - path: /etc/systemd/system/srv1cv83-ras@.service
encoding: gzip+base64 encoding: gzip+base64
owner: root:root owner: root:root
@ -128,7 +122,6 @@ autoinstall:
gqmLPCn5hU7Gby7gaHgPCs+lD0me9+RxMv4cD2W/kqQjNzbHkpALEXxRDkbDUY+9orU17py2qq7m gqmLPCn5hU7Gby7gaHgPCs+lD0me9+RxMv4cD2W/kqQjNzbHkpALEXxRDkbDUY+9orU17py2qq7m
1duSvRMedIJlG1SiDKVu7C55JxqNNtOVqsGoUYlfuQKtPb+10dmmDjsDymQicIl96PLg7dNJtWWK 1duSvRMedIJlG1SiDKVu7C55JxqNNtOVqsGoUYlfuQKtPb+10dmmDjsDymQicIl96PLg7dNJtWWK
Ipdm1/J/2tGhvJIBAAA= Ipdm1/J/2tGhvJIBAAA=
- path: /etc/nginx/sites-available/apache-proxy - path: /etc/nginx/sites-available/apache-proxy
encoding: gzip+base64 encoding: gzip+base64
owner: root:root owner: root:root
@ -150,15 +143,13 @@ autoinstall:
nRxxNIpiRwDoh+Exg14eHzAOOjMAdYfFeYpuZroxvVjOMPSO5kKdi2OwqrMpLzH7QVnFc8ST5Rdc nRxxNIpiRwDoh+Exg14eHzAOOjMAdYfFeYpuZroxvVjOMPSO5kKdi2OwqrMpLzH7QVnFc8ST5Rdc
URZgN5qWdJyF7WtgO//sPyEr/dtHaO+90n5F91WqH0wVWNgzaDuitcgqm24he/ZxrBuyM7TfTP3G URZgN5qWdJyF7WtgO//sPyEr/dtHaO+90n5F91WqH0wVWNgzaDuitcgqm24he/ZxrBuyM7TfTP3G
tbsgI/Pbhurmo070ccCxM0Sz21vH9JppDQfD3mUYBO6PQ+D4P+kPwX+oL4ivUwgAAA== tbsgI/Pbhurmo070ccCxM0Sz21vH9JppDQfD3mUYBO6PQ+D4P+kPwX+oL4ivUwgAAA==
runcmd: runcmd:
# --- fix hosts --- # --- fix hosts ---
- | - |
set -x set -x
echo " " >> /etc/hosts echo " " >> /etc/hosts
echo "127.0.0.1 localhost srv1c srv1c.local" >> /etc/hosts echo "127.0.0.1 localhost srv1c srv1c.local" >> /etc/hosts
echo "::1 localhost srv1c srv1c.local" >> /etc/hosts echo "::1 localhost srv1c srv1c.local" >> /etc/hosts
# --- force locale install --- # --- force locale install ---
- | - |
set -x set -x
@ -166,17 +157,14 @@ autoinstall:
update-locale LANG=ru_RU.UTF-8 update-locale LANG=ru_RU.UTF-8
export LC_ALL=ru_RU.UTF-8 export LC_ALL=ru_RU.UTF-8
export LANG=ru_RU.UTF-8 export LANG=ru_RU.UTF-8
# --- force set timezone --- # --- force set timezone ---
- timedatectl set-timezone Europe/Moscow - timedatectl set-timezone Europe/Moscow
# --- force apt update --- # --- force apt update ---
- | - |
set -x set -x
apt-get update apt-get update
apt-get -y dist-upgrade apt-get -y dist-upgrade
apt-get clean apt-get clean
# --- install hasp --- # --- install hasp ---
- | - |
set -x set -x
@ -185,7 +173,6 @@ autoinstall:
tar xzf /tmp/ldk/installer.tar.gz --strip-components=1 -C /tmp/ldk tar xzf /tmp/ldk/installer.tar.gz --strip-components=1 -C /tmp/ldk
sh -xc 'dpkg -i $(find /tmp/ldk -name "aksusb*amd64.deb" -type f)' sh -xc 'dpkg -i $(find /tmp/ldk -name "aksusb*amd64.deb" -type f)'
rm -rf /tmp/ldk rm -rf /tmp/ldk
# --- install ttf-mscorefonts --- # --- install ttf-mscorefonts ---
- | - |
set -x set -x
@ -194,7 +181,6 @@ autoinstall:
chown _apt:root /var/lib/update-notifier/package-data-downloads/partial/ chown _apt:root /var/lib/update-notifier/package-data-downloads/partial/
apt-get install --no-install-recommends --no-install-suggests -y ttf-mscorefonts-installer apt-get install --no-install-recommends --no-install-suggests -y ttf-mscorefonts-installer
rm -rf /var/lib/update-notifier/package-data-downloads/partial/* rm -rf /var/lib/update-notifier/package-data-downloads/partial/*
# --- install postgres --- # --- install postgres ---
- | - |
set -x set -x
@ -202,7 +188,6 @@ autoinstall:
sh /tmp/pgpro-repo-add.sh sh /tmp/pgpro-repo-add.sh
rm -f /tmp/pgpro-repo-add.sh rm -f /tmp/pgpro-repo-add.sh
apt-get install -y postgrespro-1c-15-contrib postgrespro-1c-15-jit apt-get install -y postgrespro-1c-15-contrib postgrespro-1c-15-jit
# --- postgres init --- # --- postgres init ---
- | - |
set -x set -x
@ -218,7 +203,6 @@ autoinstall:
/opt/pgpro/1c-15/bin/pg-setup service enable /opt/pgpro/1c-15/bin/pg-setup service enable
/opt/pgpro/1c-15/bin/pg-setup service start /opt/pgpro/1c-15/bin/pg-setup service start
apt-get install -y postgrespro-1c-15 apt-get install -y postgrespro-1c-15
# --- install 1c --- # --- install 1c ---
- | - |
set -x set -x
@ -236,14 +220,12 @@ autoinstall:
# stat /var/install/1c >/dev/null 2>/dev/null && $(find /tmp/1c -name "setup-full-*.run" -type f) --mode unattended --enable-components additional_admin_functions,integrity_monitoring,config_storage_server,client_full,client_thin_fib,liberica_jre,server,server_admin,ws,ru || echo skip 1c install # stat /var/install/1c >/dev/null 2>/dev/null && $(find /tmp/1c -name "setup-full-*.run" -type f) --mode unattended --enable-components additional_admin_functions,integrity_monitoring,config_storage_server,client_full,client_thin_fib,liberica_jre,server,server_admin,ws,ru || echo skip 1c install
stat /tmp/1c >/dev/null 2>/dev/null && rm -rf /tmp/1c || echo skip 1c install stat /tmp/1c >/dev/null 2>/dev/null && rm -rf /tmp/1c || echo skip 1c install
stat /opt/1cv8/x86_64 >/dev/null 2>/dev/null && ln -s $(find /opt/1cv8/x86_64 -name "8.3.*" -type d) /opt/1cv8/x86_64/current || echo skip 1c install stat /opt/1cv8/x86_64 >/dev/null 2>/dev/null && ln -s $(find /opt/1cv8/x86_64 -name "8.3.*" -type d) /opt/1cv8/x86_64/current || echo skip 1c install
# --- 1c config --- # --- 1c config ---
- | - |
echo \ \ >> /opt/1cv8/conf/conf.cfg echo \ \ >> /opt/1cv8/conf/conf.cfg
echo "JavaHome=/opt/1cv8/x86_64/current/jre" >> /opt/1cv8/conf/conf.cfg echo "JavaHome=/opt/1cv8/x86_64/current/jre" >> /opt/1cv8/conf/conf.cfg
echo "JAVA_HOME=/opt/1cv8/x86_64/current/jre" >> /opt/1cv8/conf/conf.cfg echo "JAVA_HOME=/opt/1cv8/x86_64/current/jre" >> /opt/1cv8/conf/conf.cfg
echo "UpdateDBCfg=v2" >> /opt/1cv8/conf/conf.cfg echo "UpdateDBCfg=v2" >> /opt/1cv8/conf/conf.cfg
# --- 1c web init --- # --- 1c web init ---
- | - |
set -x set -x
@ -288,7 +270,6 @@ autoinstall:
# enable+start 1c service # enable+start 1c service
stat /opt/1cv8/x86_64/current/ragent >/dev/null 2>/dev/null && systemctl enable srv1cv83@current --now || echo ignoring 1c service stat /opt/1cv8/x86_64/current/ragent >/dev/null 2>/dev/null && systemctl enable srv1cv83@current --now || echo ignoring 1c service
stat /opt/1cv8/x86_64/current/ras >/dev/null 2>/dev/null && systemctl enable srv1cv83-ras@current --now || echo ignoring 1c ras service stat /opt/1cv8/x86_64/current/ras >/dev/null 2>/dev/null && systemctl enable srv1cv83-ras@current --now || echo ignoring 1c ras service
# --- install & config webpub1c --- # --- install & config webpub1c ---
- | - |
set -x set -x
@ -301,7 +282,6 @@ autoinstall:
chown admin1c:root /etc/apache2/conf-available/1c.conf chown admin1c:root /etc/apache2/conf-available/1c.conf
sed -i "s%vrd_path:.*\$%vrd_path: /var/www-1c/vrd%" /home/admin1c/webpub1c/webpub1c.yml sed -i "s%vrd_path:.*\$%vrd_path: /var/www-1c/vrd%" /home/admin1c/webpub1c/webpub1c.yml
sed -i "s%dir_path:.*\$%dir_path: /var/www-1c/pub%" /home/admin1c/webpub1c/webpub1c.yml sed -i "s%dir_path:.*\$%dir_path: /var/www-1c/pub%" /home/admin1c/webpub1c/webpub1c.yml
# --- install opt tools --- # --- install opt tools ---
- | - |
set -x set -x
@ -312,14 +292,12 @@ autoinstall:
snap install nvim --classic snap install nvim --classic
apt-get install -y bat fd-find exa fzf apt-get install -y bat fd-find exa fzf
echo "alias bat=batcat" >> /home/admin1c/.bashrc echo "alias bat=batcat" >> /home/admin1c/.bashrc
# --- install onescript --- # --- install onescript ---
- | - |
set -x set -x
apt-get install -y mono-runtime libmono-i18n4.0-all apt-get install -y mono-runtime libmono-i18n4.0-all
curl -SLo /tmp/onescript-engine.deb https://github.com/EvilBeaver/OneScript/releases/download/v1.8.3/onescript-engine_1.8.3_all.deb curl -SLo /tmp/onescript-engine.deb https://github.com/EvilBeaver/OneScript/releases/download/v1.8.3/onescript-engine_1.8.3_all.deb
dpkg -i /tmp/onescript-engine.deb dpkg -i /tmp/onescript-engine.deb
# --- install wsdd --- # --- install wsdd ---
#- | #- |
# set -x # set -x
@ -342,7 +320,6 @@ autoinstall:
sudo -u admin1c sh -exc "cd /home/admin1c/webpub1c && . venv/bin/activate && python webpub1c.py add_module && python webpub1c.py add test1 && python webpub1c.py add test2 && python webpub1c.py add test3" sudo -u admin1c sh -exc "cd /home/admin1c/webpub1c && . venv/bin/activate && python webpub1c.py add_module && python webpub1c.py add test1 && python webpub1c.py add test2 && python webpub1c.py add test3"
systemctl restart apache2 systemctl restart apache2
# --- final --- # --- final ---
- | - |
set -x set -x
@ -351,4 +328,3 @@ autoinstall:
# remove default user folder # remove default user folder
rm -rf /home/ubuntu rm -rf /home/ubuntu
echo -- done! --- echo -- done! ---