From 080843550c5a7cbd0ab2c3dece8db2429766e7a2 Mon Sep 17 00:00:00 2001 From: Meysam Azad Date: Mon, 28 Oct 2024 14:17:22 +0700 Subject: [PATCH] fix(vmagent): make remote write url mandatory --- CHANGELOG.md | 215 ++++++++++++++++++ README.md | 9 + galaxy.yml | 2 +- .../templates/pushgateway.service.j2 | 2 +- roles/vmagent/tasks/setup-Debian.yml | 2 +- roles/vmagent/vars/main.yml | 1 - 6 files changed, 227 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e69de29..53d2d40 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -0,0 +1,215 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +## [unreleased] + +### ⚙️ Miscellaneous Tasks + +- Add ansible doctor to pre-commit hooks +- Add changelog generator to pre-commit +- Add changelog generator to pre-commit +- Remove changelog from stdout + +## [1.5.0] - 2024-10-10 + +### 🚀 Features + +- Create pushgateway role + +### ⚙️ Miscellaneous Tasks + +- *(CI)* Add sonar analysis +- Add sonar properties + +## [1.4.11] - 2024-10-07 + +### ⚙️ Miscellaneous Tasks + +- Add release badge +- Release v1.4.11 + +## [1.4.10] - 2024-10-07 + +### ⚙️ Miscellaneous Tasks + +- Complete the changelog as of today +- *(vmagent)* Docify VM protocol argument +- Release v1.4.10 + +## [1.4.9] - 2024-10-06 + +### ⚙️ Miscellaneous Tasks + +- *(CI)* Upload build to release assets + +## [1.4.8] - 2024-10-06 + +### 🐛 Bug Fixes + +- *(vmagent)* Make VM protocol optional + +## [1.4.7] - 2024-10-06 + +### 🐛 Bug Fixes + +- *(vmagent)* Modify template indentations + +## [1.4.6] - 2024-10-06 + +### 🐛 Bug Fixes + +- *(vmagent)* Verify the correctness before release + +### ⚙️ Miscellaneous Tasks + +- Modify basic auth default keys +- *(vmagent)* Disable http listen address on tests + +## [1.4.5] - 2024-10-06 + +### 🐛 Bug Fixes + +- Modify detected arch for ARM64 + +### ⚙️ Miscellaneous Tasks + +- Release v1.4.5 + +## [1.4.4] - 2024-10-06 + +### 🐛 Bug Fixes + +- *(vmagent)* Modify target password file path + +### ⚙️ Miscellaneous Tasks + +- Release v1.4.4 + +## [1.4.3] - 2024-10-06 + +### 🐛 Bug Fixes + +- *(CI)* Run tests before publishing + +### ⚙️ Miscellaneous Tasks + +- Release v1.4.3 + +## [1.4.2] - 2024-10-06 + +### 🐛 Bug Fixes + +- *(vmagent)* Provide undefined var + +## [1.4.1] - 2024-10-06 + +### 🚀 Features + +- *(vmagent)* Add fail2ban to scrape config + +### ⚙️ Miscellaneous Tasks + +- Add molecule for local testing +- *(docs)* Add the initial badges +- Upgrade vmagent to v1.104 +- *(vmagent)* Verify with http health check +- Release v1.4.0 + +## [1.3.1] - 2024-09-22 + +### 🐛 Bug Fixes + +- *(CI)* Address playbook schema issue (#4) + +### ⚙️ Miscellaneous Tasks + +- *(docs)* Use ansible doc to generate role docs +- Release v1.3.1 + +## [1.3.0] - 2024-09-21 + +### 🚀 Features + +- Create promtail and system user + +### 🐛 Bug Fixes + +- *(CI)* Install dependencies before test +- *(CI)* Place some content in requirements +- *(CI)* Create user with duplciate code even +- *(CI)* Extract promtail with expected filename +- *(CI)* Fetch and parse promtail checksum +- *(CI)* Modify undefined var name +- *(CI)* Remove extra opts from unarchive +- *(CI)* List unarchive files before using it +- *(CI)* Find promtail explicitly +- *(CI)* Remove mode and add depth +- *(CI)* Provide name and mode +- *(CI)* Now use json_query to capture the value +- *(CI)* Use ansible builtin functions to extact the path +- *(CI)* Drop find altogether +- *(CI)* Specify full path to promtail binary +- *(CI)* Provide the promtail handler + +### ⚙️ Miscellaneous Tasks + +- Release v1.3.0 +- Changelog generator to Justfile + +## [1.2.2] - 2024-09-21 + +### 🐛 Bug Fixes + +- *(CI)* Add the missing requirements.yml + +### ⚙️ Miscellaneous Tasks + +- *(CI)* Add ansible-lint job +- *(CI)* Explicitly specify trivy cache dir + +## [1.2.1] - 2024-09-21 + +### ⚙️ Miscellaneous Tasks + +- *(docs)* Provide a minimal README + +## [1.2.0] - 2024-09-21 + +### 🚀 Features + +- Initial haproxy role definition +- Create the node-exporter role +- Create the vmagent role and test the vagrant in CI +- *(CI)* Create release over tag +- *(CI)* Add release please + +### 🐛 Bug Fixes + +- *(docs)* Modify plaintext format +- *(CI)* Make it work +- *(CI)* Run the tests in MacOS +- *(CI)* Run tests on macos-12 +- *(CI)* Run tests against the runner +- *(CI)* Specify more robust conditional on j2 template +- *(CI)* Pass token +- Remove v from galaxy version +- *(CI)* Escape quotes properly + +### ⚙️ Miscellaneous Tasks + +- *(license)* Add contact info +- Initial structure +- Add the missing files for galaxy publish +- Create the vagrant machine for local tests +- *(CI)* Add some of the basic checks +- *(CI)* Cache trivy db +- *(CI)* Modify output filename for kubescape +- *(CI)* Remove kubescape +- Release v1.2.0 +- *(CI)* Specify release type +- *(CI)* Let release please handle everything +- *(main)* Release 1.3.0 (#3) +- Get rid of release please and use manual tagging + + diff --git a/README.md b/README.md index c7c2b85..09a6312 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,7 @@ - [Ansible Collections](#ansible-collections) - [Usage](#usage) + - [Release Instructions](#release-instructions) - [License](#license) @@ -32,6 +33,14 @@ collections: version: x.x.x ``` +## Release Instructions + +```shell +version=vx.x.x +git tag -s $version -m $version +git push origin --tags +``` + ## License This project is licensed under the Apache License 2.0 - see the diff --git a/galaxy.yml b/galaxy.yml index 2fa8918..52dfdb2 100644 --- a/galaxy.yml +++ b/galaxy.yml @@ -1,6 +1,6 @@ namespace: meysam81 name: general -version: 1.5.0 +version: 1.5.1 readme: README.md authors: - Meysam Azad diff --git a/roles/pushgateway/templates/pushgateway.service.j2 b/roles/pushgateway/templates/pushgateway.service.j2 index eb73d18..8a91944 100644 --- a/roles/pushgateway/templates/pushgateway.service.j2 +++ b/roles/pushgateway/templates/pushgateway.service.j2 @@ -24,10 +24,10 @@ ExecStart=/usr/local/bin/pushgateway \ {% endif %} --log.level={{ pushgateway_log_level }} \ --log.format={{ pushgateway_log_format }} +ExecReload=/bin/kill -HUP $MAINPID Restart=on-failure User={{ pushgateway_user }} Group={{ pushgateway_group }} [Install] WantedBy=multi-user.target -After=network-online.target diff --git a/roles/vmagent/tasks/setup-Debian.yml b/roles/vmagent/tasks/setup-Debian.yml index 56de76f..140f7ed 100644 --- a/roles/vmagent/tasks/setup-Debian.yml +++ b/roles/vmagent/tasks/setup-Debian.yml @@ -64,7 +64,7 @@ dest: /etc/vmagent/vmagent.yml owner: "{{ vmagent_user }}" group: "{{ vmagent_group }}" - mode: "0440" + mode: "0644" notify: Reload vmagent service - name: Start vmagent service ansible.builtin.systemd: diff --git a/roles/vmagent/vars/main.yml b/roles/vmagent/vars/main.yml index 9cb3611..ed97d53 100644 --- a/roles/vmagent/vars/main.yml +++ b/roles/vmagent/vars/main.yml @@ -1,2 +1 @@ --- -vmagent_remote_write_url: