Skip to content

feat: streamline Docker registry setup in CI workflow#1

Merged
PirateSeal merged 15 commits intomasterfrom
p-branch-1
Dec 9, 2024
Merged

feat: streamline Docker registry setup in CI workflow#1
PirateSeal merged 15 commits intomasterfrom
p-branch-1

Conversation

@PirateSeal
Copy link
Owner

Refactor the CI workflow to utilize an Ansible playbook for
setting up a private Docker registry. Remove manual steps for
installing tools and creating the registry, replacing them
with automated tasks in the playbook. This enhances
maintainability and reduces complexity in the workflow.
Update secrets usage for improved security in registry
authentication.

Refactor the CI workflow to utilize an Ansible playbook for 
setting up a private Docker registry. Remove manual steps for 
installing tools and creating the registry, replacing them 
with automated tasks in the playbook. This enhances 
maintainability and reduces complexity in the workflow. 
Update secrets usage for improved security in registry 
authentication.
Add the 'hosts' directive to the actions_test.yml file to specify 
the target hosts for the playbook. This change ensures that the 
playbook runs on all specified hosts, improving its usability 
and clarity.
Change the host from '' to 'target' in the Ansible test 
configuration to specify the intended target for the 
registry authentication test. Add a target section in the 
GitHub Actions workflow to ensure proper inventory 
configuration for the specified host.
Refactor the Ansible test workflow to improve SSH connection handling. 
Change the inventory format to use options for SSH user and private key. 
Update the playbook to target all hosts instead of a specific target. 
Add a new Ansible configuration file to disable host key checking.
Refactor the GitHub Actions workflow by splitting the 
`--extra-vars` option into two separate lines for 
better readability and clarity. This change enhances 
the maintainability of the workflow configuration.
Remove unnecessary configuration settings from the GitHub Actions 
workflow and streamline the Ansible command options. This change 
enhances readability and maintains the same functionality by using 
environment variables directly. The host key checking is now handled 
through command-line arguments, improving security and reducing 
complexity.
Change the SSH key option in the GitHub Actions workflow from 
"-v" to "--private-key" for clarity and correctness. This 
ensures the SSH key is passed correctly to the Ansible 
configuration, improving the reliability of the deployment 
process.
Replace the direct usage of the Docker SSH key secret with a 
temporary file. Add a step to create the SSH key file from 
the secret, security and ensuring compatibilitywith the Ansible action.
Add a comma and 'ssh' option to the Docker host argument in the 
GitHub Actions workflow. This change ensures proper SSH command 
execution and improves connection stability during the CI/CD 
process.
Add export of ANSIBLE_HOST_KEY_CHECKING to disable host key 
checking during the execution of the Ansible playbook This 
ensures execution in environments where keys 
are not-defined, preventing potential failures.
Change the path for the SSH key in the GitHub Actions workflow from 
`./ssh_key` to `ansible/ssh_key` to ensure the key is stored in the 
correct directory for Ansible usage. This improves organization and 
maintains consistency in file structure.
Set permissions for the SSH key file to 600 to enhance security. This 
ensures that only the owner can read and write the key, preventing 
unauthorized access during the CI process.
Replace the task that ensures the presence of apache2-utils with an 
assertion using the command module. This change improves the 
efficiency of the playbook by directly checking the package's 
installation status without modifying the system state.
Update the task for creating the registry user to use the `shell` 
module instead of `command`. This change allows for better handling 
of shell features and ensures the task does not report as changed, 
as the password file may already exist.
Adds a log message to indicate when the with-registry-auth flag is 
included in the Docker stack deploy command. This change improves 
visibility into the deployment process and helps with debugging 
by clearly showing the command's configuration.
@PirateSeal PirateSeal merged commit 0357364 into master Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant