tis-basic-config icon

Tis Base Linux

Silent install package for Tis Base Linux

1-2
System and network
System and network

  • package: tis-basic-config
  • name: Tis Base Linux
  • version: 1-2
  • categories: System and network
  • maintainer: Kévin Guérineau
  • locale: all
  • target_os: redhat_based
  • architecture: all
  • signature_date:
  • size: 11.90 Ko

package           : tis-basic-config
version           : 1-2
architecture      : all
section           : base
priority          : optional
name              : Tis Base Linux
categories        : System and network
maintainer        : Kévin Guérineau
description       : Basic configuration package for Linux servers.
depends           : 
conflicts         : 
maturity          : PROD
locale            : all
target_os         : redhat_based
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            : 
keywords          : 
licence           : 
homepage          : 
package_uuid      : 9eeb7246-a3a3-44b4-939d-557891c7724f
valid_from        : 
valid_until       : 
forced_install_on : 
changelog         : 
min_os_version    : 
max_os_version    : 
icon_sha256sum    : 7891f1ca19ac8a9e41cb2963c0833bb3424a1dcc3f89e6ae484b1841a67063b2
signer            : Tranquil IT
signer_fingerprint: 8c5127a75392be9cc9afd0dbae1222a673072c308c14d88ab246e23832e8c6bb
signature         : vLZ0NCufQceyFfCe96qSLXrGJnzb2UBPTH1ko5leGJPEet5aOeRIFl0r21p9+JlPSNa84C6csY9A/QQkJQcToC5yyjdk4GnD6Rd4pXNRqnLuuhf2NFf4I1nCQsNP9LgDvbM604Leo6IB9Q5lHPg54dO38QEw3vAfOjAndESip/0bJKxgyMtYaDrVawS0H666laLTI3p30P9ZFDtTkI8SDZwxjWxiJixrB7kcMhOXe0aBrtNgOJvOwl5xxMHX6CJsU6q7CUdj11lmqcMyYUL7d8RAmfKzDqzHsURvFs42n8M2XQVC1yDNpd7IsfZjOc71mqdswa8VVF2GIpzvDTQWrg==
signature_date    : 2023-08-02T18:03:44.719300
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', 'mlocate', 'openssh-server', 'rsync', 'iputils', 'traceroute', 'nmap', 'telnet', 'iftop',
'bind-utils', 'ethtool', 'iotop', 'screen', 'less', 'psmisc', 'chrony', 'tcpdump', 'tree',
'pciutils', 'usbutils', 'lsof', 'mtr', 'tmux', 'strace', 'htop', 'netcat',
'sudo', 'net-tools', 'gnupg2','redhat-lsb-core','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_yum(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','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('grub2-mkconfig -o /boot/grub2/grub.cfg')

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

# -*- 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
44334fd131e1443151e9027fc0e5855874b7f30d909b64bd30a24ff479fdb302 : files/bashrc_tisadmin
850f1fb2417461327625dca46c6315c20b6982dd23da073e560eee83f1a05bc6 : files/defaults.vim
c5a969a3cd5f8b1c461a8d2fb0c4a7a22677a4c3576e6dfc429c5a5f23e178ce : files/vimrc
256184b352fcdf1bb796ad4ce62ef91d83933371ab6761a5a66b25e96ff3f4f6 : setup.py
0506431355ece6d296efc398fc457515203e9532b5caa24d3e4c3d28dd277059 : update_package.py
7891f1ca19ac8a9e41cb2963c0833bb3424a1dcc3f89e6ae484b1841a67063b2 : WAPT/icon.png
a5a97261381e1d0ad46ee15916abec9c2631d0201f5cc50ceb0197a165a0bbbf : WAPT/certificate.crt
9c32166fb19537822ce038ed6b60ec024d247b5735d1340be76f085228f6fd7a : luti.json
473bb11215ace3cde8fb6dde17f1f67040080fab258696d7cc2dd287ff7c35d8 : WAPT/control