Recopie initiale

This commit is contained in:
Iwan Clement
2018-05-21 13:03:35 +02:00
commit 3f39bfa01d
319 changed files with 1543 additions and 0 deletions

6
linux/Centos.sls Normal file
View File

@@ -0,0 +1,6 @@
{% if grains['os'] == 'Centos' %}
Installation des outils specifiques Centos:
pkg.installed:
- pkgs:
- bind-utils
{% endif %}

View File

@@ -0,0 +1,8 @@
{% if grains['os_family'] == 'Debian' %}
Installation des paquets pour toute Debian:
pkg.installed:
- pkgs:
- p7zip
- dnsutils
- ethtool
{% endif %}

View File

@@ -0,0 +1,9 @@
{% if grains['os_family'] == 'Debian' %}
{% set MYKERNEL = salt['grains.get']('kernelrelease') %}
{% if 'pve' in MYKERNEL %}
# Do Nothing
{% else %}
include:
- linux.Debian.Repos.Jitsi
{% endif %}
{% endif %}

View File

@@ -0,0 +1,6 @@
jitsi stable Repository:
pkgrepo.managed:
- name: deb https://download.jitsi.org stable/
- file: /etc/apt/sources.list.d/jitsi-stable.list
- key_url: https://download.jitsi.org/jitsi-key.gpg.key
- enabled: 1

5
linux/DebianFamily.sls Normal file
View File

@@ -0,0 +1,5 @@
{% if grains['os_family'] == 'Debian' %}
include:
# - linux.Debian.DebianFamilyRepo
- linux.Debian.DebianFamilyPackage
{% endif %}

9
linux/Fedora.sls Normal file
View File

@@ -0,0 +1,9 @@
{% if grains['os'] == 'Fedora' %}
include:
- linux.Fedora.Repos.Atom
- linux.Fedora.Repos.RPMFusion
- linux.Fedora.Repos.MySaltStack
- linux.Fedora.Repos.jitsi_repo
- linux.Fedora.Common
- linux.Fedora.Physical
{% endif %}

18
linux/Fedora/Common.sls Normal file
View File

@@ -0,0 +1,18 @@
Installation des paquets pour toutes les Fedora:
pkg.installed:
- pkgs:
- fuse-sshfs
- libreoffice-langpack-fr
- keepassxc
- unzip
- zip
- unrar
- p7zip
- p7zip-plugins
- p7zip-gui
# - gnome-tweak-tool
- filezilla
- thunderbird
- nextcloud-client
- atom
- langpacks-fr

40
linux/Fedora/Physical.sls Normal file
View File

@@ -0,0 +1,40 @@
{% if grains['virtual'] == 'physical' %}
{% if grains['os'] == 'Fedora' %}
Installation des packages sur machine physique Fedora:
pkg.installed:
- pkgs:
- gnucash
- blivet-gui
- xsane
- fuse-encfs
- calibre
- vlc
- xpra
- xpra-html5
- x264
- x264-libs
- x265
- x265-libs
- dnf-automatic
- nextcloud-client
- jitsi
- remmina
- gcc
- make
- perl
# - gstreamer1-plugin-openh264
- gstreamer1-libav
- gstreamer1-plugins-ugly
- gstreamer1-plugins-good
Suppression des packages inutiles sur machine physique Fedora:
pkg.purged:
- pkgs:
- qemu-common
- qemu-kvm
- qemu-img
- libvirt-daemon-driver-qemu
- ipxe-roms-qemu
- qemu-guest-agent
{% endif %}
{% endif %}

View File

@@ -0,0 +1,8 @@
atom:
pkgrepo.managed:
- humanname: Atom Editor
- baseurl: https://packagecloud.io/AtomEditor/atom/el/7/$basearch
- enabled: 1
- gpgcheck: 0
- repo_gpgcheck: 1
- gpgkey: https://packagecloud.io/AtomEditor/atom/gpgkey

View File

@@ -0,0 +1,9 @@
MySaltstack:
pkgrepo.managed:
- humanname: My SaltStack latest Release Channel for RHEL/CentOS $releasever
- baseurl: 'http://CT-cen-repo/yum/redhat/7/$basearch/latest/'
- enabled: 1
- gpgcheck: 1
- gpgkey: 'http://CT-cen-repo/yum/redhat/7/$basearch/latest/SALTSTACK-GPG-KEY.pub'
- skip_if_unavailable: 1
- enabled_metadata: 1

View File

@@ -0,0 +1,30 @@
Installons rpmfusion:
cmd.script:
- source: salt://files/Install_RPMFusion.sh
- user: root
- group: root
- shell: /bin/bash
#rpmfusion-free:
# pkgrepo.managed:
# - humanname: RPM Fusion for Fedora $releasever - Free
# - enabled: True
# - gpgcheck: 1
# - metalink: https://mirrors.rpmfusion.org/metalink?repo=free-fedora-$releasever&arch=$basearch
# - metadata_expire: 14d
# - type: rpm-md
# - repo_gpgcheck: 0
# - gpgkey: 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmfusion-free-fedora-$releasever'
# - baseurl: http://download1.rpmfusion.org/free/fedora/releases/$releasever/Everything/$basearch/os/
#rpmfusion-nonfree:
# pkgrepo.managed:
# - humanname: RPM Fusion for Fedora $releasever - NonFree
# - enabled: True
# - gpgcheck: 1
# - metalink: https://mirrors.rpmfusion.org/metalink?repo=nonfree-fedora-$releasever&arch=$basearch
# - metadata_expire: 14d
# - type: rpm-md
# - repo_gpgcheck: 0
# - gpgkey: 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmfusion-nonfree-fedora-$releasever'
# - baseurl: http://download1.rpmfusion.org/nonfree/fedora/releases/$releasever/Everything/$basearch/os/

View File

@@ -0,0 +1,6 @@
jitsi:
pkgrepo.managed:
- humanname: Repository Jitsi
- baseurl: https://download.jitsi.org/jitsi/rpm/
- enabled: 1
- gpgcheck: 0

15
linux/LocalRepo.sls Normal file
View File

@@ -0,0 +1,15 @@
{% if grains['virtual'] != 'physical' %}
{% if grains['os'] == 'Debian' %}
/etc/apt/sources.list.d/saltstack.list:
file.managed:
- source: salt://files/DebianSaltStack.list
- user: root
- mode: 644
{% elif grains['os_family'] == 'RedHat' %}
/etc/yum.repos.d/salt-latest.repo:
file.managed:
- source: salt://files/RedHatSaltStack.repo
- user: root
- mode: 644
{% endif %}
{% endif %}

16
linux/MesAdmins.sls Normal file
View File

@@ -0,0 +1,16 @@
{% if grains['virtual'] == 'LXC' %}
Mise en place d'un administrateur de containeur:
user.present:
- name: {{ pillar['superadmusr'] }}
- fullname: {{ pillar['superadmfn'] }}
- shell: /bin/bash
- home: /home/{{ pillar['superadmusr'] }}
- createhome: True
- password: {{ pillar['superadmpwd'] }}
- hash_password: True
- uid: 9876
- gid_from_name: False
- optional_groups:
- wheel
- sudo
{% endif %}

35
linux/MesInstalls.sls Normal file
View File

@@ -0,0 +1,35 @@
{% set Champ = grains['host'] %}
{% if Champ.startswith('CT-cen-elastic') %}
# Installation du package ElasticSearch https-transport:
# pkg.installed:
# - name: {{ pillar['installtransport'] }}
Installation du package ElasticSearch OpenJDK:
pkg.installed:
- name: {{ pillar['installjdk'] }}
# - name: salt['pillar.get']
Installons ElasticSearch:
cmd.script:
- source: salt://elastic/elastic_install.sh
- user: root
- group: root
- shell: /bin/bash
{% elif Champ.startswith('CT-deb-nodejs') %}
Installons Node-JS:
cmd.script:
- source: salt://files/debian_install_nodejs.sh
- user: root
- group: root
- shell: /bin/bash
Installons Nodered:
cmd.script:
- source: salt://files/install_nodered.sh
- user: root
- group: root
- shell: /bin/bash
{% endif %}

21
linux/MesPaquets.sls Normal file
View File

@@ -0,0 +1,21 @@
{% if grains['kernel'] == 'Linux' %}
Installation des outils Linux par defaut:
pkg.installed:
- pkgs:
- less
- curl
- openssh-server
- wget
- sudo
- screen
- net-tools
- unzip
- zip
- bzip2
- bc
- git
sshd:
service.running:
- enable: True
{% endif %}

12
linux/MinionUpgrade.sls Normal file
View File

@@ -0,0 +1,12 @@
Restart Salt Minion:
cmd.run:
{%- if grains['kernel'] == 'Windows' %}
- name: 'start powershell "Restart-Service -Name salt-minion"'
{%- else %}
# fork and disown the process
- name: |-
exec 0>&- # close stdin
exec 1>&- # close stdout
exec 2>&- # close stderr
nohup salt-call --local service.restart salt-minion &
{%- endif %}

23
linux/SSHPubKeys.sls Normal file
View File

@@ -0,0 +1,23 @@
{% if grains['kernel'] == 'Linux' %}
Creation of directory /root/.ssh:
file.directory:
- name: /root/.ssh
- mode: '0700'
- user: root
- group: root
- makedirs: True
Creation of file /root/.ssh/authorized_keys:
file.managed:
- name: /root/.ssh/authorized_keys
- mode: '0600'
- user: root
- group: root
/root/.ssh/authorized_keys:
file.append:
- makedirs: True
- text:
- 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDCVrwf2Eb27XmA7jb8sso2xSQoIqDJnHyW3Q6bBjtMYJwIcxxkadYuhanb1Yv3sRTq426cBp7CQIbSDVtfY+OvuSplSjf++OePHjgT7lwdAGaXnSfSOZcwx7I1hVhPao7E0FSLbIyq8N7ipuPQsLVp9I8RGQGnJMTuDyr66q4cvb+OZshRgvvnGkWn+MX2c1840n31Nbid9JPocPilu8Sdc493LtsYVGHnzGH6Td65+BtTOlNHCoAEdFAz0AisGOrDeymbvK80iAal02Mf479PGbdt3ghKWU/rXAWNtCvQ8TvWXQl3kf5v3/PeoBMVjtzOR72mD7jRnMtKD+6jhdGX iwan@fedg70.ivanclement.maison'
- 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDHJqqwPcVYKZLzcpJInNaSGRLiWQ+Xw3gqJQba89n1m8DnzBryYN/w2Z5WPfxvycOmtl9cCZHolxlD4A754jCvo6Y7alN81na5s7L4bgUArws7nT6omxMWaQdfIEtcYuicfzQGwRDtNfRDp/ZIBc30GLNwgWfVxc5j6rRKMzo8HfXoA4FtSu/PRRzZJpRGCC+D4tuc3QzZ/15LZ17OlSh6iQX1bLnzLpeCvCgo5oSaZu9lO+yJOr9op17Hfe8YxfB5RgQVbJkC9hebbHushoFmJDp52WtzK3wm1XHCAgTYOdV4Z5+nL59vlsdEWCl1eILEbUy+8lcWlEZUTb7b4qQn iwan@fedx230.ivanclement.maison'
{% endif %}

21
linux/VMSwappiness.sls Normal file
View File

@@ -0,0 +1,21 @@
{% if grains['kernel'] == 'Linux' %}
{% if grains['virtual'] == 'qemu' %}
vm.swappiness:
sysctl.present:
- value: 1
{% elif grains['virtual'] == 'kvm' %}
vm.swappiness:
sysctl.present:
- value: 1
{% elif grains['os'] == 'Fedora' %}
vm.swappiness:
sysctl.present:
- value: 10
{% elif grains['os'] == 'CentOS' %}
{% if grains['virtual'] != 'LXC' %}
vm.swappiness:
sysctl.present:
- value: 25
{% endif %}
{% endif %}
{% endif %}

View File

@@ -0,0 +1,5 @@
{% if grains['virtual'] == 'kvm' %}
Installation de qemu-guest-agent:
pkg.installed:
- name: qemu-guest-agent
{% endif %}

7
linux/centos/init.sls Normal file
View File

@@ -0,0 +1,7 @@
Installation des outils Net-tools:
pkg.installed:
- name: net-tools
Installation de less:
pkg.installed:
- name: less

13
linux/init.sls Normal file
View File

@@ -0,0 +1,13 @@
include:
- linux.SSHPubKeys
- linux.VMSwappiness
- linux.LocalRepo
- linux.MinionUpgrade
- linux.MesPaquets
- linux.MesAdmins
- linux.MesInstalls
- linux.VirtualKVMMachines
- linux.Fedora
- linux.Centos
- linux.DebianFamily
- linux.update

3
linux/update.sls Normal file
View File

@@ -0,0 +1,3 @@
pkg.upgrade:
module.run:
- refresh: True