tis-basic-config icon

TIS Base Linux

Paquet d’installation silencieuse pour TIS Base Linux

1-6

  • package: tis-basic-config
  • name: TIS Base Linux
  • version: 1-6
  • categories: System and network
  • maintainer: Kévin Guerineau
  • editor: Tranquil IT
  • locale: all
  • target_os: ubuntu
  • architecture: all
  • signature_date:
  • size: 13.16 Ko

package           : tis-basic-config
version           : 1-6
architecture      : all
section           : base
priority          : optional
name              : TIS Base Linux
categories        : System and network
maintainer        : Kévin Guerineau
description       : Basic configuration package for Linux servers.
depends           : 
conflicts         : 
maturity          : PROD
locale            : all
target_os         : ubuntu
min_wapt_version  : 2.2
sources           : 
installed_size    : 
impacted_process  : 
description_fr    : Paquet de configuration de base des serveurs Linux.
description_pl    : Podstawowy pakiet konfiguracyjny dla serwerów Linux.
description_de    : Paket für die Grundkonfiguration von Linux-Servern.
description_es    : Paquete de configuración básica para servidores Linux.
description_pt    : Pacote de configuração básica para servidores Linux.
description_it    : Pacchetto di configurazione di base per server Linux.
description_nl    : Basisconfiguratiepakket voor Linux-servers.
description_ru    : Базовый пакет конфигурации для Linux-серверов.
audit_schedule    : 
editor            : Tranquil IT
keywords          : 
licence           : 
homepage          : 
package_uuid      : ae89c486-a4bf-47dc-8286-adba334ca7ff
valid_from        : 
valid_until       : 
forced_install_on : 
changelog         : 
min_os_version    : 
max_os_version    : 
icon_sha256sum    : 7891f1ca19ac8a9e41cb2963c0833bb3424a1dcc3f89e6ae484b1841a67063b2
signer            : Tranquil IT
signer_fingerprint: 8c5127a75392be9cc9afd0dbae1222a673072c308c14d88ab246e23832e8c6bb
signature         : FN8OwMqfIzikql6Y7RjXFt+Mw/on+iEe1yh8dBOpoxzpk4LugaRb7U4VUYMer99j2iBr30JD4+I/2fMy1/T5gQ5JS8lIMsy/Hiaw72sjQTH7IPsuwXIEes8J9CC6STHXzQdzt61Mnabldh77kLbdYVKX2VOu0M1Y3llB3FkPjCytmywZry1MChcC+w4B0LdGVmOx0um9tCehZg7Zzn6J0BvtaNdy9dkRd29IXcyq32AxJC8sVLOs0tokuqMeuHcDFvCqXYZjcfSxuBjDm8fZAnbhQqO6Z7mDkDxcX6KTvqFiH1zn0y2wAOc8hc55U7C6Tev6ixKWVsmx6KRwYnYJMw==
signature_date    : 2023-08-02T18:04:15.854627
signed_attributes : package,version,architecture,section,priority,name,categories,maintainer,description,depends,conflicts,maturity,locale,target_os,min_wapt_version,sources,installed_size,impacted_process,description_fr,description_pl,description_de,description_es,description_pt,description_it,description_nl,description_ru,audit_schedule,editor,keywords,licence,homepage,package_uuid,valid_from,valid_until,forced_install_on,changelog,min_os_version,max_os_version,icon_sha256sum,signer,signer_fingerprint,signature_date,signed_attributes

# -*- coding: utf-8 -*-
from setuphelpers import *

appli_list = ['vim', 'locate', 'ssh', 'rsync', 'arping', 'traceroute', 'nmap', 'telnet', 'iftop',
'dnsutils', 'ethtool', 'iotop', 'screen', 'less', 'psmisc', 'ntpdate', 'tcpdump', 'tree',
'pciutils', 'usbutils', 'lsof', 'mtr-tiny', 'tmux', 'strace', 'htop', 'netcat-openbsd',
'sudo', 'apt-transport-https', 'net-tools', 'gnupg2','ntp','lsb-release','dos2unix','curl']

use_apt_packages = False
use_swapfile = False
use_vim = False
use_old_naming = False
use_bashrc = False
pdiff = False

def install():
    print('Installing %s' % control.asrequirement())

    if 'tisadmin' in run('users'):
        print('Please disconnect tisadmin user before install this package')
        return "ERROR"

    if use_apt_packages:
        for appli in appli_list:
            print(f'Install {appli}')
            install_apt(appli)

    if use_swapfile:
        print('Create swapfile')
        swapfile = makepath('/var','swapfile')
        if not isfile(swapfile):
            run(f'dd if=/dev/zero of={swapfile} bs=1M count=1024')
            run(f'chmod 0600 {swapfile}')
            run(f'mkswap -c {swapfile}')
            run(f'swapon {swapfile}')
            run(f'echo "{swapfile}   none    swap    sw      0 0" >> /etc/fstab')
            run('mount -a')

    if use_vim:
        print('Configure vim')
        vim_version = installed_softwares('vim')[0]['version'].split(':')[1].split('-')[0]
        vim_version = vim_version.split('.')[0] + vim_version.split('.')[1]
        vim_path = f'/usr/share/vim/vim{vim_version}/defaults.vim'
        vim_path_dir = f'/usr/share/vim/vim{vim_version}'

        if not isdir(vim_path_dir):
            mkdirs(vim_path_dir)
        filecopyto(r'files/vimrc',makepath('/etc','vim','vimrc'))
        if isfile(vim_path):
            remove_file(vim_path)
        filecopyto(r'files/defaults.vim',vim_path)

    if use_old_naming:
        print('Use old network interface naming')
        if isfile('/etc/default/grub'):
            run(r"sed -i 's/#GRUB_DISABLE_LINUX_UUID=true/GRUB_DISABLE_LINUX_UUID=true/' /etc/default/grub")
            run(r"sed -i 's/GRUB_CMDLINE_LINUX=\"\"/GRUB_CMDLINE_LINUX=\"net.ifnames=0 biosdevname=0\"/' /etc/default/grub")
            run('update-grub')

    if use_bashrc:
        print('Copy .bashrc')
        filecopyto(r'files/bashrc_root',r'/root/.bashrc')
        filecopyto(r'files/bashrc_tisadmin',r'/home/tisadmin/.bashrc')

    if pdiff:
        print('Disable APT pdiff')
        run('echo \'Acquire::PDiffs "false";\' > /etc/apt/apt.conf.d/disable-pdiff.conf')

# -*- coding: utf-8 -*-
from setuphelpers import *

def update_package():
    commit_count = params.get("commit_count",0)

    control.version = commit_count
    control.save_control_to_wapt()

24a94c2ddb60fe6046de564e8d5e2ea971ef681d7009cb6e2e8034653b0ffa24 : files/bashrc_root
827cc5ec4eb3c55018b831034d3618520b6feb5714735701b6d51de75b629b6a : files/pam.d_su
44334fd131e1443151e9027fc0e5855874b7f30d909b64bd30a24ff479fdb302 : files/bashrc_tisadmin
850f1fb2417461327625dca46c6315c20b6982dd23da073e560eee83f1a05bc6 : files/defaults.vim
c5a969a3cd5f8b1c461a8d2fb0c4a7a22677a4c3576e6dfc429c5a5f23e178ce : files/vimrc
cb7a9301bbb4615d15ad67b51034238128d138bb25288f7fff5d1f0806162453 : setup.py
0506431355ece6d296efc398fc457515203e9532b5caa24d3e4c3d28dd277059 : update_package.py
7891f1ca19ac8a9e41cb2963c0833bb3424a1dcc3f89e6ae484b1841a67063b2 : WAPT/icon.png
a5a97261381e1d0ad46ee15916abec9c2631d0201f5cc50ceb0197a165a0bbbf : WAPT/certificate.crt
8d6810309b9b80b17a209733035a255feb148cc6c4fbba6727cd1b9dd5bb4714 : luti.json
3abc45f9f5e9aae7a5e563558e770f180c55f86ed6b3700b302f82e8f0aba3f6 : WAPT/control