forked from stove/dataset
nsd with fedora 36
This commit is contained in:
parent
41c8b44bd1
commit
6dd625670e
8 changed files with 43 additions and 12 deletions
|
@ -1,5 +1,10 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<rougail version="0.10">
|
<rougail version="0.10">
|
||||||
|
<services>
|
||||||
|
<service name="base">
|
||||||
|
<file engine="none">/etc/pam.d/login</file>
|
||||||
|
</service>
|
||||||
|
</services>
|
||||||
<variables>
|
<variables>
|
||||||
<variable name="os_version" type="string" description="Version de l'OS" hidden="True">
|
<variable name="os_version" type="string" description="Version de l'OS" hidden="True">
|
||||||
<value>36</value>
|
<value>36</value>
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
BASE_PKG="$BASE_PKG pam"
|
|
@ -1,4 +1,4 @@
|
||||||
BASE_PKG="systemd systemd-networkd systemd-resolved fedora-release-container lsof strace glibc-langpack-fr"
|
BASE_PKG="systemd systemd-networkd systemd-resolved fedora-release-container lsof strace glibc-langpack-fr $BASE_PKG"
|
||||||
INSTALL_TOOL="dnf"
|
INSTALL_TOOL="dnf"
|
||||||
OS_NAME='fedora'
|
OS_NAME='fedora'
|
||||||
REPO_DIR="$IMAGE_NAME_RISOTTO_IMAGE_DIR/etc/yum.repos.d/"
|
REPO_DIR="$IMAGE_NAME_RISOTTO_IMAGE_DIR/etc/yum.repos.d/"
|
||||||
|
|
|
@ -5,6 +5,8 @@ from os.path import join
|
||||||
from filecmp import dircmp
|
from filecmp import dircmp
|
||||||
from difflib import unified_diff
|
from difflib import unified_diff
|
||||||
from sys import stdout, argv
|
from sys import stdout, argv
|
||||||
|
from os import walk
|
||||||
|
from os.path import join
|
||||||
from datetime import datetime, timezone
|
from datetime import datetime, timezone
|
||||||
|
|
||||||
|
|
||||||
|
@ -13,16 +15,16 @@ OLD_DIR = argv[2]
|
||||||
NEW_DIR = argv[3]
|
NEW_DIR = argv[3]
|
||||||
WEBSITE = len(argv) != 5
|
WEBSITE = len(argv) != 5
|
||||||
|
|
||||||
FILES = []
|
|
||||||
def diff_files(dcmp):
|
def diff_files(dcmp):
|
||||||
|
files = []
|
||||||
for name in dcmp.diff_files:
|
for name in dcmp.diff_files:
|
||||||
FILES.append(join(dcmp.right[len(NEW_DIR):], name))
|
files.append(join(dcmp.right[len(NEW_DIR):], name))
|
||||||
for sub_dcmp in dcmp.subdirs.values():
|
for sub_dcmp in dcmp.subdirs.values():
|
||||||
diff_files(sub_dcmp)
|
files.extend(diff_files(sub_dcmp))
|
||||||
|
return files
|
||||||
|
|
||||||
|
|
||||||
dcmp = dircmp(OLD_DIR, NEW_DIR)
|
dcmp = dircmp(OLD_DIR, NEW_DIR)
|
||||||
diff_files(dcmp)
|
|
||||||
|
|
||||||
date = datetime.now(timezone.utc).isoformat()
|
date = datetime.now(timezone.utc).isoformat()
|
||||||
title = f"Nouvelle version de la configuration de {os_name}"
|
title = f"Nouvelle version de la configuration de {os_name}"
|
||||||
|
@ -42,18 +44,19 @@ authors = ["Automate"]
|
||||||
[extra]
|
[extra]
|
||||||
lead = "{subtitle}."
|
lead = "{subtitle}."
|
||||||
type = "installe"
|
type = "installe"
|
||||||
+++
|
+++""")
|
||||||
""")
|
|
||||||
TITLE = True
|
TITLE = True
|
||||||
else:
|
else:
|
||||||
TITLE = False
|
TITLE = False
|
||||||
for filename in FILES:
|
|
||||||
|
|
||||||
|
for filename in diff_files(dcmp):
|
||||||
if not TITLE:
|
if not TITLE:
|
||||||
print(title)
|
print(title)
|
||||||
print("=" * len(title))
|
print("=" * len(title))
|
||||||
print()
|
print()
|
||||||
TITLE = True
|
TITLE = True
|
||||||
print(f'- mise à jour du fichier {filename} :\n')
|
print(f'\n- mise à jour du fichier {filename} :\n')
|
||||||
try:
|
try:
|
||||||
with open(join(OLD_DIR, filename[1:]), 'r') as ori:
|
with open(join(OLD_DIR, filename[1:]), 'r') as ori:
|
||||||
ori_content = ori.readlines()
|
ori_content = ori.readlines()
|
||||||
|
@ -68,3 +71,26 @@ for filename in FILES:
|
||||||
print(line.rstrip())
|
print(line.rstrip())
|
||||||
if WEBSITE:
|
if WEBSITE:
|
||||||
print('```')
|
print('```')
|
||||||
|
|
||||||
|
|
||||||
|
old = set()
|
||||||
|
new = set()
|
||||||
|
for rootname, set_ in ((OLD_DIR, old), (NEW_DIR, new)):
|
||||||
|
len_rootname = len(rootname) + 1
|
||||||
|
for dirname, _, filenames in walk(rootname):
|
||||||
|
for filename in filenames:
|
||||||
|
set_.add(join(dirname[len_rootname:], filename))
|
||||||
|
|
||||||
|
|
||||||
|
for filename in old - new:
|
||||||
|
print(f'\n- fichier {filename} supprimé.\n')
|
||||||
|
|
||||||
|
|
||||||
|
for filename in new - old:
|
||||||
|
print(f'\n- fichier {filename} ajouté :\n')
|
||||||
|
with open(join(NEW_DIR, filename), 'r') as fh:
|
||||||
|
if WEBSITE:
|
||||||
|
print('```')
|
||||||
|
print(fh.read())
|
||||||
|
if WEBSITE:
|
||||||
|
print('```')
|
||||||
|
|
|
@ -5,7 +5,7 @@ if [ -z "$HOST_NAME" ]; then
|
||||||
echo "usage: $0 host name"
|
echo "usage: $0 host name"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
apt install --yes systemd-container dnf jq debootstrap htop gettext patch unzip mlocate
|
apt install --yes systemd-container dnf jq debootstrap htop gettext patch unzip mlocate xz-utils
|
||||||
systemd-tmpfiles --create --clean --remove $PWD/host/configurations/$HOST_NAME/tmpfiles.d/0asystemd-nspawn.conf
|
systemd-tmpfiles --create --clean --remove $PWD/host/configurations/$HOST_NAME/tmpfiles.d/0asystemd-nspawn.conf
|
||||||
systemd-tmpfiles --create --clean --remove $PWD/host/configurations/$HOST_NAME/tmpfiles.d/0rougail.conf
|
systemd-tmpfiles --create --clean --remove $PWD/host/configurations/$HOST_NAME/tmpfiles.d/0rougail.conf
|
||||||
systemctl daemon-reload
|
systemctl daemon-reload
|
||||||
|
|
|
@ -2,5 +2,5 @@ format: '0.1'
|
||||||
description: Configuration du serveur faisant autorité NSD
|
description: Configuration du serveur faisant autorité NSD
|
||||||
service: true
|
service: true
|
||||||
depends:
|
depends:
|
||||||
- base-fedora-35
|
- base-fedora-36
|
||||||
provider: LocalDNS
|
provider: LocalDNS
|
||||||
|
|
|
@ -6,7 +6,6 @@
|
||||||
<file engine="none" source="sysuser-peertube.conf">/sysusers.d/0peertube.conf</file>
|
<file engine="none" source="sysuser-peertube.conf">/sysusers.d/0peertube.conf</file>
|
||||||
<file engine="none" source="tmpfile-peertube.conf">/tmpfiles.d/0peertube.conf</file>
|
<file engine="none" source="tmpfile-peertube.conf">/tmpfiles.d/0peertube.conf</file>
|
||||||
<file>/etc/peertube/production.yaml</file>
|
<file>/etc/peertube/production.yaml</file>
|
||||||
<file engine="none">/etc/pam.d/login</file>
|
|
||||||
<file source="nginx.peertube.conf">/etc/nginx/conf.d/peertube.conf</file>
|
<file source="nginx.peertube.conf">/etc/nginx/conf.d/peertube.conf</file>
|
||||||
</service>
|
</service>
|
||||||
</services>
|
</services>
|
||||||
|
|
Loading…
Reference in a new issue