add nodiscc.xsrv.gitea_act_runner ansible role #142

Merged
jolheiser merged 1 commits from nodiscc/awesome-gitea:xsrv-act-runner into main 2023-11-26 14:19:56 +00:00
Contributor

This is similar to #97 and I would write a summary for it like I did last time, but as you can see, the commit seems to have changed all line endings (I committed from the web interface).

Steps to reproduce:

  • Fork https://gitea.com/gitea/awesome-gitea/ from the web UI
  • navigate to README.md, click the edit button
  • add one line
  • select Create a new branch for this commit and start a Pull Request, enter a commit message
  • click the Propose file change button
  • the diff shows all lines as changed (217 additions, 216 deletions)

Please let me know how I should proceed.

- ref. https://gitea.com/gitea/awesome-gitea/pulls/97 - ref. https://github.com/go-gitea/gitea/issues/23704 ---- This is similar to https://gitea.com/gitea/awesome-gitea/pulls/97 and I would write a summary for it like I did last time, **but** as you can see, the commit seems to have changed all line endings (I committed from the web interface). Steps to reproduce: - Fork https://gitea.com/gitea/awesome-gitea/ from the web UI - navigate to README.md, click the edit button - add one line - select `Create a new branch for this commit and start a Pull Request`, enter a commit message - click the `Propose file change button` - the diff shows all lines as changed (217 additions, 216 deletions) Please let me know how I should proceed.
nodiscc added 1 commit 2023-11-21 15:35:51 +00:00
All checks were successful
lint / lint (pull_request) Successful in 10s
c86055cf0e
add nodiscc.xsrv.gitea_act_runner ansible role
- ref. #97
- ref. https://github.com/go-gitea/gitea/issues/23704
Author
Contributor

On https://gitea.com/gitea/awesome-gitea/pulls/142/files, clicking the Whitespace button and selecting Ignores changes in whitespace at EOL displays the diff as it is supposed to look

image

But I think it is still wrong to merge this as-is.

On https://gitea.com/gitea/awesome-gitea/pulls/142/files, clicking the `Whitespace` button and selecting `Ignores changes in whitespace at EOL` displays the diff as it is supposed to look ![image](/attachments/155f4917-fe38-4951-bfa1-85cad83d1e89) But I think it is still wrong to merge this as-is.
Owner
Interesting....yeah, seems entirely related to the web UI. Commit from web UI: https://gitea.com/gitea/awesome-gitea/compare/main...jolheiser/awesome-gitea:nodiscc-ansible-web Commit made locally: https://gitea.com/gitea/awesome-gitea/compare/main...jolheiser/awesome-gitea:nodiscc-ansible
Author
Contributor

@jolheiser Thanks!

As for the summary, it is similar to #97

$ mkdir -p ~/playbooks/myproject && cd ~/playbooks/myproject
$ python3 -m venv .venv
$ source .venv/bin/activate
$ pip3 install ansible
# requirements.yml
collections:
  - name: https://gitlab.com/nodiscc/xsrv.git
    type: git
    version: release # or master to get the latest, development version
# inventory.yml
all:
  hosts:
    my.CHANGEME.org:
# playbook.yml
- hosts: my.CHANGEME.org
  roles:
    - nodiscc.xsrv.common # (optional) base server setup/hardening/firewall/bruteforce prevention
    - nodiscc.xsrv.monitoring # (optional) server monitoring, log aggregation
    - nodiscc.xsrv.gitea # (optional, the gitea instance can be on a separate host, you will just have to set the variables below)
    - nodiscc.xsrv.gitea_act_runner
# $ mkdir host_vars/my.CHANGEME.org
# host_vars/my.CHANGEME.org/my.CHANGEME.org.yml
gitea_act_runner_gitea_instance_fqdn: "git.CHANGEME.org" # required if the runner and gitea instance are on different hosts
gitea_act_runner_gitea_instance_hostname: "my2.CHANGEME.org" # required if the runner and gitea instance are on different hosts
# make the role/collection available to the ansible project
$ ansible-galaxy collection install --force -r requirements.yml
# deploy the role
$ ansible-playbook -i inventory.yml playbook.yml

See defaults/main.yml for all available configuration variables.

Currently the gitea instance you want to register the runner on, must be managed by the same ansible playbook/project - at least, the hostname must be present in the inventory, and the sudo credentials in the host_vars/ansible-vault file, as they are used for automatically creating the runner token and register it on the instance.

Edit: The role uses rootless podman as default container management toolkit, but was also tested with docker. I will send a patch for Gitea's documentation to detail the changes needed to make it work with podman.

@jolheiser Thanks! As for the summary, it is similar to https://gitea.com/gitea/awesome-gitea/pulls/97 ```bash $ mkdir -p ~/playbooks/myproject && cd ~/playbooks/myproject $ python3 -m venv .venv $ source .venv/bin/activate $ pip3 install ansible ``` ```yaml # requirements.yml collections: - name: https://gitlab.com/nodiscc/xsrv.git type: git version: release # or master to get the latest, development version ``` ```yaml # inventory.yml all: hosts: my.CHANGEME.org: ``` ```yaml # playbook.yml - hosts: my.CHANGEME.org roles: - nodiscc.xsrv.common # (optional) base server setup/hardening/firewall/bruteforce prevention - nodiscc.xsrv.monitoring # (optional) server monitoring, log aggregation - nodiscc.xsrv.gitea # (optional, the gitea instance can be on a separate host, you will just have to set the variables below) - nodiscc.xsrv.gitea_act_runner ``` ```yaml # $ mkdir host_vars/my.CHANGEME.org # host_vars/my.CHANGEME.org/my.CHANGEME.org.yml gitea_act_runner_gitea_instance_fqdn: "git.CHANGEME.org" # required if the runner and gitea instance are on different hosts gitea_act_runner_gitea_instance_hostname: "my2.CHANGEME.org" # required if the runner and gitea instance are on different hosts ``` ```bash # make the role/collection available to the ansible project $ ansible-galaxy collection install --force -r requirements.yml # deploy the role $ ansible-playbook -i inventory.yml playbook.yml ``` See [defaults/main.yml](https://github.com/nodiscc/xsrv/blob/master/roles/gitea_act_runner/defaults/main.yml) for all available configuration variables. Currently the gitea instance you want to register the runner on, must be managed by the same ansible playbook/project - at least, the hostname must be present in the inventory, and the sudo credentials in the `host_vars`/ansible-vault file, as they are used for automatically [creating the runner token and register it on the instance](https://github.com/nodiscc/xsrv/blob/master/roles/gitea_act_runner/tasks/act-runner.yml#L135). Edit: The role uses rootless `podman` as default container management toolkit, but was also tested with docker. I will send a patch for Gitea's documentation to detail the changes needed to make it work with podman.
techknowlogick approved these changes 2023-11-24 18:25:39 +00:00
Owner

Please resolve the conflicts

Please resolve the conflicts
nodiscc force-pushed xsrv-act-runner from c86055cf0e to 9f6edd1132 2023-11-26 13:42:11 +00:00 Compare
nodiscc force-pushed xsrv-act-runner from 9f6edd1132 to 17985c8169 2023-11-26 13:43:15 +00:00 Compare
Author
Contributor

Commit remade locally to avoid the bug mentioned above, rebased on main.

Commit remade locally to avoid the bug mentioned above, rebased on `main`.
jolheiser requested changes 2023-11-26 14:18:43 +00:00
jolheiser left a comment
Owner

Thanks!

Thanks!
jolheiser approved these changes 2023-11-26 14:19:29 +00:00
jolheiser left a comment
Owner

Darn mobile UI shifted on me when approving..

Darn mobile UI shifted on me when approving..
jolheiser merged commit 7be1f3f53c into main 2023-11-26 14:19:56 +00:00
nodiscc deleted branch xsrv-act-runner 2023-11-26 14:44:58 +00:00
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No Assignees
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: gitea/awesome-gitea#142
No description provided.