Before deploying, ensure the following dependencies and configurations are met:
- Ansible installed on the control node.
- SSH access to the target server.
- Required credentials stored securely in
ansible/roles/deploy/vars/main.yml
. - Ansible inventory file (
inventory.ini
) with the target server IP and SSH key.
Ensure the following variables are set in ansible/roles/deploy/vars/main.yml
:
---
# CAS credentials for notarization
deploy_cas_signer_id: "your_signer_id"
deploy_cas_api_key: "your_api_key"
deploy_immudb_username: "your_username"
deploy_immudb_password: "your_password"
deploy_immudb_database: "your_database"
deploy_immudb_address: "your_immudb_address"
# Slack credentials to send notifications
deploy_slack_token: "your_slack_token"
# Git authentication key
deploy_auth_key: "your_git_auth_key"
# SSH keys for git.almalinux.org
deploy_ssh_private_key: "your_private_key"
deploy_ssh_public_key: "your_public_key"
Define the target hosts in your Ansible inventory file (e.g., inventory.ini
):
[deploy_servers]
your-server-ip ansible_user=your_user ansible_ssh_private_key_file=your_key
Execute the deployment playbook with:
ansible-playbook -i inventory.ini main.yml
After deployment, verify that the service is running properly:
systemctl status almalinux-autopatch.service
- Description: Replaces a specified strings with anothers.
- Fields:
target
: Path to the file or “spec” (indicates the spec file). Glob patterns are supported.find
: String to search for (supports multi-lines).replace
: String to replace with (supports multi-lines).count
: Number of replacements (default is -1, which replaces all occurrences).
Example:
- replace_string:
- target: "*.conf"
find: "RHEL"
replace: "AlmaLinux"
count: 1
- target: "spec"
find: |
%if 0%{?rhel}
RHEL
replace: |
%if 0%{?almalinux}
AlmaLinux
- Description: Deletes specified lines.
- Fields:
target
: Path to the file or “spec”. Does not support glob patterns.lines
: List of lines to delete (supports multi-lines).
Example:
- delete_line:
- target: "README.md"
lines:
- "line1"
- |
hello world
additional line
- Description: Adds a suffix to the release number.
- Fields:
suffix
: Suffix to append to the release number.enabled
: Enables or disables the modification (default is true).
Example:
- modify_release:
- suffix: ".mycustom.1"
enabled: true
- Description: Adds entries to the changelog.
- Fields:
name
: Author’s name.email
: Author’s email.line
: Lines to add to the changelog (also used as commit messages).
Example:
- changelog_entry:
- name: "eabdullin"
email: "[email protected]"
line:
- "Updated branding to AlmaLinux"
- "Fixed a typo in the README"
- Description: Adds source files or patches.
- Fields:
type
: File type (patch or source).name
: File name. Should be placed in thefiles
directory of the autopatch namespace repository.number
: Patch/file number or “Latest” (default is “Latest”).
Example:
- add_files:
- type: "patch"
name: "my_patch.patch"
number: "Latest"
- type: "source"
name: "additional_source.tar.gz"
number: 1000
- Description: Deletes files from the repository.
- Fields:
file_name
: File name to delete.
Example:
- delete_files:
- file_name: "file1.txt"
- file_name: "file2"
- Description: Executes user-defined scripts to prepare the package before performing other actions (e.g., creating symbolic links).
- Fields:
script
: script name. Should be placed in thescripts
directory of autopatch namespace repositorycwd
: "rpms" or "autopatch" ('rpms' by default).
Example:
- run_script:
- script: "custom_script.sh"
cwd: "rpms"