Compare commits
7 Commits
1726c412ce
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| b36d658ba1 | |||
| 5e1555e87f | |||
| 39d43cfe03 | |||
| 7247d0e25f | |||
| 1f59077a7f | |||
| 151e56e2cf | |||
| e2b71b8ae0 |
4
TODO
Normal file
4
TODO
Normal file
@@ -0,0 +1,4 @@
|
||||
screenrc
|
||||
apt remove triggerhappy
|
||||
restic pulls x86 on the pi
|
||||
install python3-dev for manual pip setup
|
||||
@@ -1,6 +1,6 @@
|
||||
import re
|
||||
import logging
|
||||
from subprocess import check_output
|
||||
from subprocess import check_output, CalledProcessError
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
@@ -8,8 +8,8 @@ def main():
|
||||
dev_re = re.compile(r"Bus\s+(\d+)\s+Device\s+(\d+):\s+ID\s(\w+:\w+)\s(.+)$")
|
||||
try:
|
||||
lsusb = check_output("lsusb", encoding='UTF-8')
|
||||
except OSError as exc:
|
||||
log.error(exc)
|
||||
except (CalledProcessError, OSError) as exc:
|
||||
log.debug(exc)
|
||||
return {}
|
||||
devices = []
|
||||
corsair_aio = None
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
- user: root
|
||||
- group: root
|
||||
- mode: 644
|
||||
- makedirs: true
|
||||
|
||||
verify_vhost_includes:
|
||||
cmd.wait:
|
||||
@@ -25,7 +26,7 @@ queue_httpd_graceful:
|
||||
- watch:
|
||||
- cmd: rebuildhttpdconf
|
||||
|
||||
/home/{{ salt.pillar.get('gitea:user') }}/public_html/.htaccess:
|
||||
{{ salt.pillar.get('gitea:docroot') }}/.htaccess:
|
||||
file.managed:
|
||||
- source: 'salt://gitea/files/htaccess.jinja'
|
||||
- template: jinja
|
||||
|
||||
@@ -1,23 +1,36 @@
|
||||
{% from "salt/map.jinja" import salt_daemons with context %}
|
||||
{% from "salt/deb_install/map.jinja" import osrelease, oscodename with context %}
|
||||
|
||||
/etc/apt/keyrings/salt-archive-keyring-2023.gpg:
|
||||
/etc/apt/keyrings/salt-archive-keyring-2023.pgp:
|
||||
file.managed:
|
||||
- source: https://repo.saltproject.io/salt/py3/{{ grains['os'].lower() }}/{{ osrelease }}/amd64/SALT-PROJECT-GPG-PUBKEY-2023.gpg
|
||||
- source_hash: c6f6cbcd96fdb130b1dde8dcfc05d46a3a3f322ff0514f98e2e6473896243472
|
||||
- source: https://packages.broadcom.com/artifactory/api/security/keypair/SaltProjectKey/public
|
||||
- source_hash: 36decef986477acb8ba2a1fc4041bcf9f22229ef6c939d0317c9e36a9d142b34
|
||||
|
||||
/etc/apt/sources.list.d/salt.list:
|
||||
file.managed:
|
||||
- contents: "deb [signed-by=/etc/apt/keyrings/salt-archive-keyring-2023.gpg arch=amd64] https://repo.saltproject.io/salt/py3/{{ grains['os'].lower() }}/{{ osrelease }}/amd64/minor/{{ salt.pillar.get("salt:version") }} {{ oscodename }} main"
|
||||
- contents: deb [signed-by=/etc/apt/keyrings/salt-archive-keyring-2023.pgp arch=amd64] https://packages.broadcom.com/artifactory/saltproject-deb/ stable main
|
||||
|
||||
salt-common:
|
||||
pkg.installed:
|
||||
- version: '{{ salt.pillar.get("salt:version") }}'
|
||||
- refresh: true
|
||||
- require:
|
||||
- file: /etc/apt/keyrings/salt-archive-keyring-2023.gpg
|
||||
- file: /etc/apt/keyrings/salt-archive-keyring-2023.pgp
|
||||
- file: /etc/apt/sources.list.d/salt.list
|
||||
|
||||
salt {{ salt.pillar.get("salt:version") }}:
|
||||
pkg.held:
|
||||
- pkgs:
|
||||
- salt-common
|
||||
{% for daemon in salt_daemons %}
|
||||
- salt-{{ daemon }}
|
||||
{% endfor %}
|
||||
- require:
|
||||
- pkg: salt-common
|
||||
{% for daemon in salt_daemons %}
|
||||
- pkg: salt-{{ daemon }}
|
||||
{% endfor %}
|
||||
|
||||
{% for daemon in salt_daemons %}
|
||||
salt-{{ daemon }}:
|
||||
pkg.installed:
|
||||
|
||||
@@ -12,4 +12,4 @@ mysql.default_file: '/root/.my.cnf'
|
||||
mine_functions:
|
||||
root_id_rsa_pub:
|
||||
- mine_function: file.read
|
||||
- /root/.ssh/id_rsa.pub
|
||||
- /root/.ssh/id_ed25519.pub
|
||||
|
||||
@@ -17,11 +17,11 @@ smbd:
|
||||
- template: jinja
|
||||
- check_cmd: /usr/bin/testparm -d 0 -s
|
||||
|
||||
{# generate these with print(hashlib.new('md4', "password".encode('utf-16le')).hexdigest()) #}
|
||||
{% for user, passw in salt.pillar.get('samba:users', {}).items() %}
|
||||
samba_{{user}}:
|
||||
pdbedit.managed:
|
||||
- name: {{user}}
|
||||
- password: {{passw}}
|
||||
- password_hashed: True
|
||||
{% endfor %}
|
||||
#{# generate these with print(hashlib.new('md4', "password".encode('utf-16le')).hexdigest()) #}
|
||||
#{% for user, passw in salt.pillar.get('samba:users', {}).items() %}
|
||||
#samba_{{user}}:
|
||||
# pdbedit.managed:
|
||||
# - name: {{user}}
|
||||
# - password: {{passw}}
|
||||
# - password_hashed: True
|
||||
#{% endfor %}
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
# TODO
|
||||
2
setup.sh
2
setup.sh
@@ -64,7 +64,7 @@ if ! [ -e /usr/bin/salt-call ]; then
|
||||
/opt/saltstack/salt/bin/pip3 install "salt==$SALT_VERSION"
|
||||
ln -sfT /opt/saltstack/salt/bin/salt-call /usr/bin/salt-call
|
||||
elif [[ "$DISTRO" == "centos" ]] || [[ "$DISTRO" == "almalinux" ]]; then
|
||||
if [[ "$DISTRO" == "almalinux" ]]
|
||||
if [[ "$DISTRO" == "almalinux" ]]; then
|
||||
OS_VERSION="$(python3 -m distro --json | jq -r .version_parts.major)"
|
||||
fi
|
||||
rpm --import https://repo.saltproject.io/salt/py3/redhat/$OS_VERSION/x86_64/SALT-PROJECT-GPG-PUBKEY-2023.pub
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
'HostName': 'kpi.keiran.us',
|
||||
'User': restic_repo.split(':')[1],
|
||||
'Port': 9022,
|
||||
'IdentityFile': '/root/.ssh/id_rsa',
|
||||
'IdentityFile': '/root/.ssh/id_ed25519',
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,12 @@
|
||||
screen:
|
||||
pkg.installed: []
|
||||
|
||||
/root/.screenrc:
|
||||
file.managed:
|
||||
- source: salt://users/files/screenrc
|
||||
- user: root
|
||||
- group: root
|
||||
- mode: 640
|
||||
|
||||
{% if salt.pillar.get('manage_root_bashrc', False) %}
|
||||
/root/.bashrc:
|
||||
@@ -6,7 +15,7 @@
|
||||
- template: jinja
|
||||
- user: root
|
||||
- group: root
|
||||
- mode: 0640
|
||||
- mode: 640
|
||||
- context:
|
||||
bashrc_user: root
|
||||
{% endif %}
|
||||
@@ -41,6 +50,14 @@
|
||||
bashrc_user: {{ user }}
|
||||
- require:
|
||||
- user: {{ user }}_user
|
||||
|
||||
{{ homedir }}/.screenrc:
|
||||
file.managed:
|
||||
- source: salt://users/files/screenrc
|
||||
- user: {{ user }}
|
||||
- group: {{ user }}
|
||||
- mode: 640
|
||||
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
Reference in New Issue
Block a user