Compare commits
10 commits
50e1e9a375
...
caa645156b
| Author | SHA1 | Date | |
|---|---|---|---|
| caa645156b | |||
| 1b76078afa | |||
| 0603a52a83 | |||
| 7b325dc6ea | |||
| 103e4b6c8a | |||
| 2e379a0626 | |||
| 052e52780e | |||
| 16bb3c3c9f | |||
| a0404abf13 | |||
| 57fdc23cae |
8 changed files with 103 additions and 33 deletions
|
|
@ -3,6 +3,7 @@
|
|||
exclude_paths:
|
||||
- ".gitlab/*"
|
||||
- ".gitlab-ci.yml"
|
||||
- ".woodpecker/*"
|
||||
- "defaults/main.yaml"
|
||||
- "meta/main.yaml"
|
||||
- "vars/*"
|
||||
|
|
|
|||
|
|
@ -1,13 +0,0 @@
|
|||
---
|
||||
|
||||
# gitlab stages
|
||||
stages:
|
||||
- "gitleaks"
|
||||
- "linting"
|
||||
|
||||
# include components
|
||||
include:
|
||||
- component: "$CI_SERVER_FQDN/components/ansible/linting@v3.0.3"
|
||||
- component: "$CI_SERVER_FQDN/components/gitleaks/gitleaks@v1.0.0"
|
||||
- component: "$CI_SERVER_FQDN/components/markdownlint/markdownlint@1.0.0"
|
||||
- component: "$CI_SERVER_FQDN/components/yamllint/yamllint@1.0.2"
|
||||
|
|
@ -6,7 +6,8 @@
|
|||
// linting rules
|
||||
"config": {
|
||||
"MD013": {
|
||||
"line_length": 120
|
||||
"line_length": 120,
|
||||
"tables": false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
41
.woodpecker/linting.yml
Normal file
41
.woodpecker/linting.yml
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
---
|
||||
when:
|
||||
- event: "push"
|
||||
branch: "main"
|
||||
- event: "manual"
|
||||
|
||||
steps:
|
||||
|
||||
# gitleaks
|
||||
- name: "gitleaks"
|
||||
# renovate: datasource=github-releases depName=gitleaks/gitleaks
|
||||
image: "cr.simoncor.net/ghcr/gitleaks/gitleaks:v8.30.1"
|
||||
commands:
|
||||
- "gitleaks detect --source . --verbose --redact"
|
||||
|
||||
# yamllint
|
||||
- name: "yamllint"
|
||||
# renovate: datasource=docker depName=cr.simoncor.net/yamllint
|
||||
image: "cr.simoncor.net/yamllint:1.38.0"
|
||||
depends_on:
|
||||
- "gitleaks"
|
||||
commands:
|
||||
- "yamllint -c .yamllint ."
|
||||
|
||||
# ansible-lint
|
||||
- name: "ansible-lint"
|
||||
# renovate: datasource=docker depName=docker.io/pipelinecomponents/ansible-lint
|
||||
image: "cr.simoncor.net/dockerhub/pipelinecomponents/ansible-lint:0.79.11"
|
||||
depends_on:
|
||||
- "gitleaks"
|
||||
commands:
|
||||
- "ansible-lint -c .ansible-lint ."
|
||||
|
||||
# markdownlint
|
||||
- name: "markdownlint"
|
||||
# renovate: datasource=docker depName=docker.io/davidanson/markdownlint-cli2
|
||||
image: "cr.simoncor.net/dockerhub/davidanson/markdownlint-cli2:v0.22.1"
|
||||
depends_on:
|
||||
- "gitleaks"
|
||||
commands:
|
||||
- "markdownlint-cli2 --config .markdownlint-cli2.jsonc"
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
---
|
||||
|
||||
# renovate: datasource=github-releases depName=atuinsh/atuin versioning=pep440
|
||||
atuin_version: "18.13.5"
|
||||
atuin_version: "18.16.1"
|
||||
|
||||
# atuin db creds
|
||||
atuin_db_host: "localhost"
|
||||
|
|
|
|||
26
readme.md
26
readme.md
|
|
@ -1,13 +1,23 @@
|
|||
# Overview
|
||||
# Ansible Role: Atuin
|
||||
|
||||
This role configures [Atuin](<https://atuin.sh/>) server, for reasons.
|
||||
Install and configure [Atuin](https://atuin.sh/) - a shell history sync server.
|
||||
|
||||
## Supported Operating Systems
|
||||
## Variables
|
||||
|
||||
| Operating System | Version |
|
||||
| --- | ----- |
|
||||
| Debian | 13 |
|
||||
| Variable | Required | Default | Description |
|
||||
| --------------- | -------- | ----------- | ------------------------ |
|
||||
| `atuin_version` | No | `18.13.6` | Atuin version to install |
|
||||
| `atuin_db_host` | No | `localhost` | Database host |
|
||||
| `atuin_db_name` | No | `atuin` | Database name |
|
||||
| `atuin_db_user` | No | `atuin` | Database user |
|
||||
| `atuin_db_pass` | Yes | `atuin` | Database password |
|
||||
|
||||
## Tags
|
||||
## Example
|
||||
|
||||
This role has no tags.
|
||||
```yaml
|
||||
atuin_version: "18.13.6"
|
||||
atuin_db_host: "localhost"
|
||||
atuin_db_name: "atuin"
|
||||
atuin_db_user: "atuin"
|
||||
atuin_db_pass: "secure_password"
|
||||
```
|
||||
|
|
|
|||
|
|
@ -2,5 +2,5 @@
|
|||
|
||||
roles:
|
||||
- name: "atuin"
|
||||
src: "https://gitlab.simoncor.net/ansible/ans-atuin.git"
|
||||
src: "https://git.simoncor.net/ansible/atuin.git"
|
||||
scm: "git"
|
||||
|
|
|
|||
|
|
@ -1,22 +1,52 @@
|
|||
---
|
||||
|
||||
# check current atuin version
|
||||
- name: "check current version"
|
||||
# check current atuin server version
|
||||
- name: "check current atuin server version"
|
||||
ansible.builtin.shell:
|
||||
cmd: "/usr/local/bin/atuin-server --version"
|
||||
changed_when: false
|
||||
failed_when: false
|
||||
register: "atuin_version_check"
|
||||
register: "atuin_server_version_check"
|
||||
|
||||
# delete current atuin version
|
||||
- name: "delete current version"
|
||||
# check current atuin client version
|
||||
- name: "check current atuin client version"
|
||||
ansible.builtin.shell:
|
||||
cmd: "/usr/local/bin/atuin --version"
|
||||
changed_when: false
|
||||
failed_when: false
|
||||
register: "atuin_client_version_check"
|
||||
|
||||
# delete current atuin client
|
||||
- name: "delete current client"
|
||||
ansible.builtin.file:
|
||||
path: "/usr/local/bin/atuin"
|
||||
state: "absent"
|
||||
when: "atuin_version not in atuin_client_version_check.stdout"
|
||||
|
||||
# delete current atuin server
|
||||
- name: "delete current server"
|
||||
ansible.builtin.file:
|
||||
path: "/usr/local/bin/atuin-server"
|
||||
state: "absent"
|
||||
when: "atuin_version not in atuin_version_check.stdout"
|
||||
when: "atuin_version not in atuin_server_version_check.stdout"
|
||||
|
||||
# install atuin
|
||||
- name: "install atuin"
|
||||
# install atuin client
|
||||
- name: "install atuin client"
|
||||
ansible.builtin.unarchive:
|
||||
src:
|
||||
"https://github.com/atuinsh/atuin/releases/download/\
|
||||
v{{ atuin_version }}/atuin-x86_64-unknown-linux-gnu.tar.gz"
|
||||
dest: "/usr/local/bin/"
|
||||
include: "atuin-x86_64-unknown-linux-gnu/atuin"
|
||||
extra_opts: ["--strip-components=1"]
|
||||
owner: "root"
|
||||
group: "root"
|
||||
mode: "0755"
|
||||
remote_src: true
|
||||
when: "atuin_version not in atuin_client_version_check.stdout"
|
||||
|
||||
# install atuin server
|
||||
- name: "install atuin server"
|
||||
ansible.builtin.unarchive:
|
||||
src:
|
||||
"https://github.com/atuinsh/atuin/releases/download/\
|
||||
|
|
@ -29,7 +59,7 @@
|
|||
mode: "0755"
|
||||
remote_src: true
|
||||
notify: "restart atuin"
|
||||
when: "atuin_version not in atuin_version_check.stdout"
|
||||
when: "atuin_version not in atuin_server_version_check.stdout"
|
||||
|
||||
# install systemd service
|
||||
- name: "install service"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue