Skip to content

Commit

Permalink
Truthy
Browse files Browse the repository at this point in the history
  • Loading branch information
buluma committed Mar 26, 2024
1 parent 0b22c25 commit fda88bf
Show file tree
Hide file tree
Showing 10 changed files with 41 additions and 29 deletions.
26 changes: 19 additions & 7 deletions .github/workflows/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,21 @@ jobs:
fail-fast: false
matrix:
config:
- image: "debian-systemd"
- image: "docker-molecule-images"
tag: "bullseye"
- image: "enterpriselinux"
tag: "8"
- image: "docker-ubuntu-systemd"
tag: "latest"
- image: "docker-ubuntu-systemd"
- image: "docker-molecule-images"
tag: "ubuntu_latest"
- image: "docker-molecule-images"
tag: "focal"
- image: "docker-ubuntu-systemd"
- image: "docker-molecule-images"
tag: "bionic"
- image: "docker-ubuntu-systemd"
- image: "docker-molecule-images"
tag: "jammy"
- image: "docker-molecule-images"
tag: "lunar"
- image: "docker-ubuntu-systemd"
- image: "docker-molecule-images"
tag: "noble"
steps:
- name: Checkout Role
Expand Down Expand Up @@ -94,3 +96,13 @@ jobs:
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# test_role:
# needs:
# - lint
# - test
# runs-on: ubuntu-20.04
#
# steps:
# - uses: "actions/checkout@master"
# - name: Test Role
# run: "ansible-galaxy role import --api-key {{ secrets.galaxy_api_key }} buluma {{ role_name }}"
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ repos:
- repo: https://github.com/buluma/pre-commit
rev: v1.0.3
hooks:
- id: ansible_role_find_unused_variable
# - id: ansible_role_find_unused_variable
- id: ansible_role_find_empty_files
- id: ansible_role_find_empty_directories
- id: ansible_role_find_undefined_handlers
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ This example is taken from [`molecule/default/converge.yml`](https://github.com/
---
- name: Converge
hosts: all
become: yes
gather_facts: yes
become: true
gather_facts: true

roles:
- role: buluma.jenkins
Expand All @@ -27,8 +27,8 @@ The machine needs to be prepared. In CI this is done using [`molecule/default/pr
---
- name: Prepare
hosts: all
become: yes
gather_facts: no
become: true
gather_facts: false
roles:
- role: buluma.bootstrap
Expand Down
2 changes: 1 addition & 1 deletion meta/preferences.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
tox_parallel: yes
tox_parallel: true
4 changes: 2 additions & 2 deletions molecule/default/converge.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
- name: Converge
hosts: all
become: yes
gather_facts: yes
become: true
gather_facts: true

roles:
- role: ansible-role-jenkins
4 changes: 2 additions & 2 deletions molecule/default/prepare.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
- name: Prepare
hosts: all
become: yes
gather_facts: no
become: true
gather_facts: false

roles:
- role: buluma.bootstrap
Expand Down
6 changes: 3 additions & 3 deletions molecule/default/verify.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
- name: Verify
hosts: all
become: yes
gather_facts: no
become: true
gather_facts: false

tasks:
- name: Check if connection still works
Expand All @@ -11,7 +11,7 @@
- name: Check web ui
ansible.builtin.uri:
url: "http://localhost:8080/login"
return_content: yes
return_content: true
register: jenkins_check_web_ui
failed_when:
- "'Jenkins' not in jenkins_check_web_ui.content"
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ansible-compat == 4.*
molecule == 6.*
molecule == 24.*
molecule-plugins[docker] == 23.*
ansible-lint == 6.*
ansible-lint == 24.*
paramiko == 3.*
# Pinning requests version due to [bug](https://github.com/docker/docker-py/issues/3113)
# requests == 2.28.1
6 changes: 3 additions & 3 deletions tasks/assert.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,21 @@
- jenkins_port is number
- jenkins_port > 0
- jenkins_port < 65535
quiet: yes
quiet: true

- name: assert | Test jenkins_listen_address
ansible.builtin.assert:
that:
- jenkins_listen_address is defined
- jenkins_listen_address is string
- jenkins_listen_address is not none
quiet: yes
quiet: true

- name: assert | Test jenkins_version
ansible.builtin.assert:
that:
- jenkins_version is string
- jenkins_version is not none
quiet: yes
quiet: true
when:
- jenkins_version is defined
8 changes: 4 additions & 4 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
- name: Import assert.yml
ansible.builtin.import_tasks:
file: assert.yml
run_once: yes
run_once: true
delegate_to: localhost

- name: Add yum repository
ansible.builtin.get_url:
url: "{{ jenkins_yum_repository_baseurl }}"
dest: /etc/yum.repos.d/jenkins.repo
validate_certs: no
validate_certs: false
mode: "0644"
when:
- ansible_pkg_mgr in [ "dnf", "yum" ]
Expand All @@ -20,7 +20,7 @@
ansible.builtin.rpm_key:
key: "{{ jenkins_rpm_key }}"
state: present
validate_certs: no
validate_certs: false
when:
- ansible_pkg_mgr in [ "dnf", "yum", "zypper" ]

Expand Down Expand Up @@ -79,4 +79,4 @@
ansible.builtin.service:
name: jenkins
state: started
enabled: yes
enabled: true

0 comments on commit fda88bf

Please sign in to comment.