Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ubuntu image update #360

Open
wants to merge 88 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
241a52a
sanity fix
domendobnikar Aug 2, 2023
afc0593
white space fix
domendobnikar Aug 2, 2023
88e0cfa
fixing title line
domendobnikar Aug 2, 2023
b5733f0
image update
domendobnikar Aug 16, 2023
2f52395
Merge branch 'master' of https://github.com/sensu/sensu-go-ansible
domendobnikar Aug 16, 2023
6bb2f5a
Merge branch 'master' of https://github.com/domendobnikar/sensu-go-an…
domendobnikar Aug 16, 2023
2433ddf
test new matrix
domendobnikar Aug 16, 2023
9ff30ef
test matrix
domendobnikar Aug 16, 2023
c157524
maxtrix test
domendobnikar Aug 16, 2023
8b45892
matrix test
domendobnikar Aug 16, 2023
cd14a56
matrix test
domendobnikar Aug 16, 2023
b0b9c8e
matrix test
domendobnikar Aug 16, 2023
2d7a022
maxtrix test
domendobnikar Aug 16, 2023
fea8e11
matrix test
domendobnikar Aug 16, 2023
f14991a
matrix test
domendobnikar Aug 16, 2023
576fe83
matrix test
domendobnikar Aug 16, 2023
bd82f8b
matrix test
domendobnikar Aug 16, 2023
855e384
matrix test
domendobnikar Aug 16, 2023
e55a8f6
matrix test
domendobnikar Aug 16, 2023
fe78594
adding back unit tests
domendobnikar Aug 16, 2023
5b7138d
adding back integration test_git
domendobnikar Aug 16, 2023
0d494b0
adding other workflows back
domendobnikar Aug 16, 2023
0979958
adding other workflows back fix
domendobnikar Aug 16, 2023
58539e3
testing cron_ansible_devel
domendobnikar Aug 16, 2023
1490889
cron_ansible_devel fix
domendobnikar Aug 16, 2023
f5fd1a1
cron_ansible_devel fix
domendobnikar Aug 16, 2023
c3a564e
cron_ansible_devel fix
domendobnikar Aug 16, 2023
c360441
updating ubuntu image in cron_ansible_devel
domendobnikar Aug 16, 2023
0345f36
test changes
domendobnikar Aug 16, 2023
9874715
testing python version
domendobnikar Aug 16, 2023
c194ebc
testing ansible-lint
domendobnikar Aug 16, 2023
ffd84d1
testing roles ansible-lint
domendobnikar Aug 16, 2023
ea1f75a
cehck ansible version
domendobnikar Aug 16, 2023
48b72d4
testing ansible-lint
domendobnikar Aug 16, 2023
f537597
ubuntu image
domendobnikar Aug 16, 2023
2731331
updating ubuntu image
domendobnikar Aug 16, 2023
86fb5fd
python3 version check
domendobnikar Aug 16, 2023
9dddf96
unit test update
domendobnikar Aug 16, 2023
6436514
unit test fix
domendobnikar Aug 16, 2023
cabfd16
sanity fix
domendobnikar Aug 16, 2023
a3a4b18
unit test fix
domendobnikar Aug 16, 2023
23cc964
adding make sanity
domendobnikar Aug 21, 2023
ba38e93
removing make file from cron devel
domendobnikar Aug 21, 2023
353231f
sanity fix
domendobnikar Aug 21, 2023
7a30ef5
sanity fix
domendobnikar Aug 21, 2023
40aa9c3
removing deprecated unit tests
domendobnikar Aug 21, 2023
361f024
removing lines from ignore files
domendobnikar Aug 21, 2023
2226ab8
revert
domendobnikar Aug 21, 2023
d1d2fa0
adding ignore files
domendobnikar Aug 21, 2023
e4b539c
ignore files
domendobnikar Aug 21, 2023
23485b1
devel ignore file
domendobnikar Aug 21, 2023
224b408
updating ignore file for devel
domendobnikar Aug 21, 2023
9c70a65
Adding to ignore file, returning unit tests
domendobnikar Aug 21, 2023
b7349dc
Fixing assert statement
domendobnikar Aug 21, 2023
88759cf
assertion error fix
domendobnikar Aug 21, 2023
61cba01
reverting back to old image
domendobnikar Aug 23, 2023
8b3f1bf
changes
domendobnikar Aug 23, 2023
7ae523a
adding ansible 215 to pipeline
domendobnikar Aug 23, 2023
b4ce6bb
updating ansible-lint version for tests
domendobnikar Aug 23, 2023
57b0707
updating role playbooks to satisfy updated ansible-lint
domendobnikar Aug 23, 2023
c1de8e9
requirement file update
domendobnikar Aug 23, 2023
4561165
requirements update
domendobnikar Aug 23, 2023
87f3e4c
adding flake8 to requirement file
domendobnikar Aug 23, 2023
c3ae253
requirement file
domendobnikar Aug 23, 2023
445fb18
adding exceptions for ansible 215
domendobnikar Aug 23, 2023
c898980
fixing sanity issues
domendobnikar Aug 23, 2023
6d38311
changing service to systemd_service
domendobnikar Aug 23, 2023
53d004d
reverting back to service
domendobnikar Aug 23, 2023
c5bcbaa
change to systemd
domendobnikar Aug 23, 2023
13f35cd
Update config.yml
domendobnikar Aug 23, 2023
89bc6e0
Update config.yml
domendobnikar Aug 23, 2023
462df5c
removing start service
domendobnikar Aug 31, 2023
576a9ab
adding sudo
domendobnikar Aug 31, 2023
600439d
Update config.yml
domendobnikar Aug 31, 2023
c746019
Update sanity.requirements
domendobnikar Aug 31, 2023
d4ef134
Update sanity.requirements
domendobnikar Aug 31, 2023
ebd077d
Update config.yml
domendobnikar Aug 31, 2023
98a63d0
adding c_groupns_mode to molecule
domendobnikar Sep 1, 2023
deb9337
raising molecule version for newer python versions
domendobnikar Sep 1, 2023
8313d91
changing to /sys/fs/cgroup:rw
domendobnikar Sep 1, 2023
2351acd
switching to centos:8
domendobnikar Sep 1, 2023
2922d4a
systemd to service
domendobnikar Sep 1, 2023
54cd772
to centos:7
domendobnikar Sep 1, 2023
8a0ba6a
misc_api_cert test
domendobnikar Sep 1, 2023
534e702
Update config.yml
domendobnikar Sep 1, 2023
61b8448
testing modified centos 7 image
domendobnikar Sep 1, 2023
d66965a
workflow file update
domendobnikar Sep 1, 2023
28e02d0
workflow file update
domendobnikar Sep 1, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .ansible-lint-ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# This file contains ignores rule violations for ansible-lint
roles/agent/tasks/start.yml schema[tasks]
113 changes: 100 additions & 13 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,23 @@ workflows:
matrix: &matrix
parameters:
# ansible is branch name in ansible/ansible git repo
ansible:
- stable-2.9
- stable-2.10
- stable-2.11
- stable-2.12
- stable-2.13
- stable-2.14

ansible: ["stable-2.9", "stable-2.10", "stable-2.11", "stable-2.12", "stable-2.13", "stable-2.14", "stable-2.15"]
image_ubuntu: ["ubuntu-2004:202101-01", "ubuntu-2204:2023.07.2"]
exclude:
- ansible: "stable-2.9"
image_ubuntu: "ubuntu-2204:2023.07.2"
- ansible: "stable-2.10"
image_ubuntu: "ubuntu-2204:2023.07.2"
- ansible: "stable-2.11"
image_ubuntu: "ubuntu-2204:2023.07.2"
- ansible: "stable-2.12"
image_ubuntu: "ubuntu-2204:2023.07.2"
- ansible: "stable-2.13"
image_ubuntu: "ubuntu-2204:2023.07.2"
- ansible: "stable-2.14"
image_ubuntu: "ubuntu-2204:2023.07.2"
- ansible: "stable-2.15"
image_ubuntu: "ubuntu-2004:202101-01"

- unit_test:
matrix: *matrix
Expand All @@ -24,13 +33,51 @@ workflows:
requires:
- sanity_test
- unit_test
matrix: *matrix
matrix:
parameters:
# ansible is branch name in ansible/ansible git repo
ansible: ["stable-2.9", "stable-2.10", "stable-2.11", "stable-2.12", "stable-2.13", "stable-2.14", "stable-2.15"]
image_ubuntu: ["ubuntu-2004:202101-01", "ubuntu-2204:2023.07.2"]
exclude:
- ansible: "stable-2.9"
image_ubuntu: "ubuntu-2204:2023.07.2"
- ansible: "stable-2.10"
image_ubuntu: "ubuntu-2204:2023.07.2"
- ansible: "stable-2.11"
image_ubuntu: "ubuntu-2204:2023.07.2"
- ansible: "stable-2.12"
image_ubuntu: "ubuntu-2204:2023.07.2"
- ansible: "stable-2.13"
image_ubuntu: "ubuntu-2204:2023.07.2"
- ansible: "stable-2.14"
image_ubuntu: "ubuntu-2204:2023.07.2"
- ansible: "stable-2.15"
image_ubuntu: "ubuntu-2004:202101-01"

- integration_test_galaxy:
filters: { branches: { only: [ stable ] } }
requires:
- integration_test_git
matrix: *matrix
matrix:
parameters:
# ansible is branch name in ansible/ansible git repo
ansible: ["stable-2.9", "stable-2.10", "stable-2.11", "stable-2.12", "stable-2.13", "stable-2.14", "stable-2.15"]
image_ubuntu: ["ubuntu-2004:202101-01", "ubuntu-2204:2023.07.2"]
exclude:
- ansible: "stable-2.9"
image_ubuntu: "ubuntu-2204:2023.07.2"
- ansible: "stable-2.10"
image_ubuntu: "ubuntu-2204:2023.07.2"
- ansible: "stable-2.11"
image_ubuntu: "ubuntu-2204:2023.07.2"
- ansible: "stable-2.12"
image_ubuntu: "ubuntu-2204:2023.07.2"
- ansible: "stable-2.13"
image_ubuntu: "ubuntu-2204:2023.07.2"
- ansible: "stable-2.14"
image_ubuntu: "ubuntu-2204:2023.07.2"
- ansible: "stable-2.15"
image_ubuntu: "ubuntu-2004:202101-01"

cron_master:
triggers:
Expand All @@ -56,17 +103,18 @@ workflows:
cron: "12 5 * * 2,5"
filters: { branches: { only: [ master ] } }
jobs:
- sanity_test:
- sanity_test_devel:
matrix: &devel-matrix
parameters:
ansible: [ devel ]
image_ubuntu: [ "ubuntu-2204:2023.07.2" ]

- unit_test:
matrix: *devel-matrix

- integration_test_git:
requires:
- sanity_test
- sanity_test_devel
- unit_test
matrix: *devel-matrix

Expand All @@ -84,8 +132,11 @@ jobs:
ansible:
description: Ansible version to use
type: string
image_ubuntu:
description: Ubuntu image
type: string
machine: &ci-machine
image: ubuntu-2004:202101-01
image: << parameters.image_ubuntu >>
working_directory: ~/ansible_collections/sensu/sensu_go
steps:
- wrapper:
Expand All @@ -94,11 +145,36 @@ jobs:
test_commands:
- run: make sanity

sanity_test_devel:
parameters:
ansible:
description: Ansible version to use
type: string
image_ubuntu:
description: Ubuntu image
type: string
machine: *ci-machine
working_directory: ~/ansible_collections/sensu/sensu_go
steps:
- wrapper:
ansible: << parameters.ansible >>
kind: sanity
test_commands:
- run: pip3 install -r sanity.requirements -r collection.requirements
- run: python3 --version
- run: ansible --version
# ansible-lint can't find roles for some reason;
# pylint inside ansible-test finds them ...
- run: ansible-test sanity

unit_test:
parameters:
ansible:
description: Ansible version to use
type: string
image_ubuntu:
description: Ubuntu image
type: string
machine: *ci-machine
working_directory: ~/ansible_collections/sensu/sensu_go
steps:
Expand All @@ -119,9 +195,17 @@ jobs:
ansible:
description: Ansible version to use
type: string
image_ubuntu:
description: Ubuntu image
type: string
machine: *ci-machine
working_directory: ~/sensu_go
steps:
- run:
command: |
sudo apt-get update
sudo apt-get install -y dbus
# service dbus start # Start D-Bus service
- wrapper:
ansible: << parameters.ansible >>
kind: integration
Expand All @@ -136,6 +220,9 @@ jobs:
ansible:
description: Ansible version to use
type: string
image_ubuntu:
description: Ubuntu image
type: string
machine: *ci-machine
working_directory: ~/sensu_go
steps:
Expand Down
1 change: 1 addition & 0 deletions docker/centos-7.docker
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ RUN ( \
/usr/bin/python /usr/bin/python2-config sudo \
yum-plugin-ovl bash iproute; \
sed -i 's/plugins=0/plugins=1/g' /etc/yum.conf; \
yum -y update systemd; \
yum clean all; \
chmod 777 /root;

Expand Down
3 changes: 2 additions & 1 deletion integration.requirements
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
molecule ~= 5.0.1
molecule ~= 6.0.1; python_version >= "3.10"
molecule ~= 5.0.1; python_version < "3.10"
molecule-docker ~= 2.1.0
pytest
pytest-molecule ~= 2.0.0
1 change: 1 addition & 0 deletions plugins/modules/datastore.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
- The maximum number of connections to hold in the PostgreSQL connection
pool.
type: int
default: 0
max_conn_lifetime:
description:
- Maximum time a connection can persist before being destroyed.
Expand Down
4 changes: 2 additions & 2 deletions roles/agent/handlers/main.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---
- name: Restart Linux agent
service:
ansible.builtin.service:
name: sensu-agent
state: restarted
when: manage_sensu_agent_service | default(False)

- name: Restart Windows agent
action:
module: win_service
module: ansible.windows.win_service
name: SensuAgent
state: restarted
when: manage_sensu_agent_service | default(False)
Expand Down
4 changes: 2 additions & 2 deletions roles/agent/tasks/configure.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
- name: Configure agent (Linux)
include_tasks: linux/configure.yml
ansible.builtin.include_tasks: linux/configure.yml
when: ansible_facts.os_family != "Windows"

- name: Configure agent (Windows)
include_tasks: windows/configure.yml
ansible.builtin.include_tasks: windows/configure.yml
when: ansible_facts.os_family == "Windows"
6 changes: 3 additions & 3 deletions roles/agent/tasks/linux/configure.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
- name: Load Linux locations
include_vars: linux.yml
ansible.builtin.include_vars: linux.yml

- name: Install agent communication PKI
copy:
ansible.builtin.copy:
src: "{{ agent_trusted_ca_file }}"
dest: "{{ trusted_ca_file_path }}"
# Keep this in sync with what the backend service is running as from packager
Expand All @@ -13,7 +13,7 @@
when: agent_trusted_ca_file is defined

- name: Configure sensu-agent ({{ agent_config_path }})
template:
ansible.builtin.template:
src: agent.yml.j2
dest: "{{ agent_config_path }}"
owner: *sensu_user
Expand Down
10 changes: 5 additions & 5 deletions roles/agent/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
---
- name: Install sensu-go-agent binary
include_role:
ansible.builtin.include_role:
name: install
vars:
components: [sensu-go-agent]
components: [sensu-go-agent] # noqa: var-naming[no-role-prefix]

- name: Inform restart handler that we are in charge of the agent service
set_fact:
ansible.builtin.set_fact:
manage_sensu_agent_service: true

- name: Configure the agent
include_tasks: configure.yml
ansible.builtin.include_tasks: configure.yml

- name: Start the agent
include_tasks: start.yml
ansible.builtin.include_tasks: start.yml
4 changes: 2 additions & 2 deletions roles/agent/tasks/start.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
---
- name: Start sensu-agent (Linux)
service:
ansible.builtin.service:
name: sensu-agent
state: started
enabled: true
when: ansible_facts.os_family != "Windows"

- name: Start sensu-agent (Windows)
action:
module: win_service
module: ansible.windows.win_service
name: SensuAgent
path: C:\Program Files\sensu\sensu-agent\bin\sensu-agent.exe service run
state: started
Expand Down
6 changes: 3 additions & 3 deletions roles/agent/tasks/windows/configure.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
---
- name: Load Windows locations
include_vars: windows.yml
ansible.builtin.include_vars: windows.yml

- name: Install agent communication PKI
win_copy:
ansible.windows.win_copy:
src: "{{ agent_trusted_ca_file }}"
dest: "{{ trusted_ca_file_path }}"
when: agent_trusted_ca_file is defined

- name: Configure sensu-agent ({{ agent_config_path }})
win_template:
ansible.windows.win_template:
src: agent.yml.j2
dest: "{{ agent_config_path }}"
notify: Restart Windows agent
2 changes: 1 addition & 1 deletion roles/backend/handlers/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
- name: Restart backend
service:
ansible.builtin.service:
name: sensu-backend
state: restarted
when: manage_sensu_backend_service | default(False)
8 changes: 4 additions & 4 deletions roles/backend/tasks/configure.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
- name: Install etcd communication PKI
copy:
ansible.builtin.copy:
src: "{{ item.source }}"
dest: "/etc/sensu/{{ item.filename }}"
# Keep this in sync with what the backend service is running as from packager
Expand All @@ -27,7 +27,7 @@
etcd_peer_key_file is defined

- name: Install API communication PKI
copy:
ansible.builtin.copy:
src: "{{ item.source }}"
dest: "/etc/sensu/{{ item.filename }}"
owner: *sensu_user
Expand All @@ -45,7 +45,7 @@
api_trusted_ca_file is defined

- name: Install dashboard communication PKI
copy:
ansible.builtin.copy:
src: "{{ item.source }}"
dest: "/etc/sensu/{{ item.filename }}"
owner: *sensu_user
Expand All @@ -61,7 +61,7 @@
when: dashboard_cert_file is defined or dashboard_key_file is defined

- name: Configure sensu-backend (/etc/sensu/backend.yml)
template:
ansible.builtin.template:
src: backend.yml.j2
dest: /etc/sensu/backend.yml
owner: *sensu_user
Expand Down
10 changes: 5 additions & 5 deletions roles/backend/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
---
- name: Install sensu-go-backend binary
include_role:
ansible.builtin.include_role:
name: install
vars:
components: [sensu-go-backend]
components: [sensu-go-backend] # noqa: var-naming[no-role-prefix]

- name: Inform restart handler that we are in charge of the backend service
set_fact:
ansible.builtin.set_fact:
manage_sensu_backend_service: true

- name: Configure the backend
include_tasks: configure.yml
ansible.builtin.include_tasks: configure.yml

- name: Start the backend
include_tasks: start.yml
ansible.builtin.include_tasks: start.yml
Loading