2024-09-24 15:12:33 +02:00
|
|
|
# Legal Notice
|
|
|
|
|
|
|
|
|
|
This is part of A13Labs project, any unauthorized copy is no allowed. If you got access to this
|
|
|
|
|
code DELETE immediately. We have been warned.
|
|
|
|
|
|
2024-10-06 01:45:58 +02:00
|
|
|
# Updating Nextcloud
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
# Enable maintenance
|
|
|
|
|
/bin/occ maintenance:mode --on
|
|
|
|
|
# Update config.tf
|
|
|
|
|
# Apply
|
|
|
|
|
# Run maintenance operations
|
|
|
|
|
./bin/occ upgrade
|
|
|
|
|
./bin/occ db:add-missing-columns
|
|
|
|
|
./bin/occ db:add-missing-indices
|
|
|
|
|
./bin/occ db:add-missing-primary-keys
|
|
|
|
|
# Disable maintenance
|
|
|
|
|
./bin/occ maintenance:mode --off
|
2025-04-25 17:48:19 +02:00
|
|
|
```
|
|
|
|
|
|
|
|
|
|
# Contabo CLI
|
|
|
|
|
|
|
|
|
|
Download latest version from [here](https://github.com/contabo/cntb/releases).
|
|
|
|
|
|
|
|
|
|
Setup:
|
|
|
|
|
```
|
|
|
|
|
sectool exec cntb get instances --oauth2-clientid="$CONTABO_CLIENT_ID" --oauth2-client-secret="$CONTABO_CLIENT_SECRET" --oauth2-user="$CONTABO_API_USER" --oauth2-password="$CONTABO_API_PASSWORD"
|
2025-07-05 21:36:47 +02:00
|
|
|
```
|
|
|
|
|
|
|
|
|
|
# Windows
|
|
|
|
|
|
2025-10-25 23:54:05 +02:00
|
|
|
## Create a Dedicated “Ansible” User (One-Time Setup) — Linux
|
2025-07-05 21:36:47 +02:00
|
|
|
|
|
|
|
|
```
|
2025-10-25 23:54:05 +02:00
|
|
|
# Create the provision user (Debian/Ubuntu)
|
|
|
|
|
sudo useradd -m -s /bin/bash -G sudo provision
|
|
|
|
|
sudo passwd provision
|
|
|
|
|
|
|
|
|
|
# OR (RHEL/CentOS/Fedora)
|
|
|
|
|
sudo useradd -m -s /bin/bash -G wheel provision
|
|
|
|
|
sudo passwd provision
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
# Allow passwordless sudo for the provision user (recommended for Ansible)
|
|
|
|
|
echo 'provision ALL=(ALL) NOPASSWD:ALL' | sudo tee /etc/sudoers.d/provision
|
|
|
|
|
sudo chmod 440 /etc/sudoers.d/provision
|
|
|
|
|
|
|
|
|
|
# Or edit safely:
|
|
|
|
|
sudo visudo -f /etc/sudoers.d/provision
|
|
|
|
|
# and add:
|
|
|
|
|
# provision ALL=(ALL) NOPASSWD:ALL
|
2025-07-06 14:08:22 +02:00
|
|
|
```
|
2025-07-05 21:36:47 +02:00
|
|
|
|
2025-10-25 23:54:05 +02:00
|
|
|
```
|
|
|
|
|
# Install SSH authorized key for the provision user (recommended over passwords)
|
|
|
|
|
sudo -u provision mkdir -p /home/provision/.ssh
|
|
|
|
|
sudo -u provision chmod 700 /home/provision/.ssh
|
|
|
|
|
echo "<your_public_key_here>" | sudo -u provision tee /home/provision/.ssh/authorized_keys
|
|
|
|
|
sudo -u provision chmod 600 /home/provision/.ssh/authorized_keys
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Notes:
|
|
|
|
|
- Replace <your_public_key_here> with the actual public key.
|
|
|
|
|
- Use a strong password if you must set one; prefer SSH keys.
|
|
|
|
|
- For tighter security, restrict the sudoers entry to only the commands Ansible requires instead of ALL.
|
|
|
|
|
- Validate sudoers syntax with visudo to avoid lockout.
|
|
|
|
|
|
2025-07-05 21:36:47 +02:00
|
|
|
## Configure windows to allow Ansible to connect via WinRM
|
|
|
|
|
|
|
|
|
|
Copy the script located in scripts "ConfigureRemotingForAnsible.ps1" and run it on the target machine.
|
|
|
|
|
|
2025-07-06 14:08:22 +02:00
|
|
|
```
|
2025-07-05 21:36:47 +02:00
|
|
|
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
|
|
|
|
|
.\ConfigureRemotingForAnsible.ps1
|
2025-07-06 14:08:22 +02:00
|
|
|
```
|
|
|
|
|
|
|
|
|
|
# Using MSYS2
|
|
|
|
|
|
|
|
|
|
Upgrade your system:
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
pacman -Syu
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Install the following packages:
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
mingw-w64-ucrt-x86_64-go
|
|
|
|
|
mingw-w64-ucrt-x86_64-make
|
|
|
|
|
mingw-w64-ucrt-x86_64-python
|
|
|
|
|
ucrt-w64-ucrt-x86_64-gcc
|
|
|
|
|
mingw-w64-ucrt-x86_64-python-cryptography
|
|
|
|
|
mingw-w64-ucrt-x86_64-python-paramiko
|
|
|
|
|
mingw-w64-ucrt-x86_64-python-rpds-py
|
|
|
|
|
python-lxml
|
|
|
|
|
mingw-w64-ucrt-x86_64-python-ruamel-yaml
|
|
|
|
|
mingw-w64-ucrt-x86_64-python-sspilib
|
|
|
|
|
unzip
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Create a python environment use:
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
python -m venv .venv --system-site-packages
|
|
|
|
|
```
|