Skip to content

Commit

Permalink
fixes to make compat with new ansible versions
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric Anderson committed Mar 5, 2024
1 parent 8a2b90c commit af3341b
Show file tree
Hide file tree
Showing 24 changed files with 158 additions and 169 deletions.
9 changes: 0 additions & 9 deletions .ansible-lint

This file was deleted.

14 changes: 7 additions & 7 deletions .github/workflows/kompose.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
---
name: "ericsysmin.kubernetes.kompose"
name: ericsysmin.kubernetes.kompose
on:
push:
paths:
- 'roles/kompose/**'
- 'molecule/kompose/**'
- '.github/workflows/kompose.yml'
- roles/kompose/**
- molecule/kompose/**
- .github/workflows/kompose.yml
pull_request:
paths:
- 'roles/kompose/**'
- 'molecule/kompose/**'
- '.github/workflows/kompose.yml'
- roles/kompose/**
- molecule/kompose/**
- .github/workflows/kompose.yml
jobs:
kompose:
runs-on: ubuntu-18.04
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/kubectl.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
---
name: "ericsysmin.kubernetes.kubectl"
name: ericsysmin.kubernetes.kubectl
on:
push:
paths:
- 'roles/kubectl/**'
- 'molecule/kubectl/**'
- '.github/workflows/kubectl.yml'
- roles/kubectl/**
- molecule/kubectl/**
- .github/workflows/kubectl.yml
pull_request:
paths:
- 'roles/kubectl/**'
- 'molecule/kubectl/**'
- '.github/workflows/kubectl.yml'
- roles/kubectl/**
- molecule/kubectl/**
- .github/workflows/kubectl.yml
jobs:
kubectl:
runs-on: ubuntu-18.04
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: "release"
name: release
on:
release:
types:
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# ignore vscode settings
.vscode
35 changes: 0 additions & 35 deletions .yamllint

This file was deleted.

9 changes: 9 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
===================================
Ericsysmin.Kubernetes Release Notes
===================================

.. contents:: Topics

v1.0.0
======

32 changes: 21 additions & 11 deletions build/galaxy_deploy.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,47 @@
---
- hosts: localhost
# code: language=ansible
- name: Deploy collection to galaxy
hosts: localhost
connection: local
gather_facts: false
vars:
# This should be set via the command line at runtime.
tag: "{{ github_tag.split('/')[-1] }}"
pre_tasks:
- name: Ensure the ANSIBLE_GALAXY_TOKEN environment variable is set.
fail:
ansible.builtin.fail:
msg: ANSIBLE_GALAXY_TOKEN is not set.
when: "lookup('env','ANSIBLE_GALAXY_TOKEN') | length == 0"
when: lookup('env', 'ANSIBLE_GALAXY_TOKEN') | length == 0

- name: Ensure the ~/.ansible directory exists.
file:
ansible.builtin.file:
path: ~/.ansible
state: directory
mode: "0755"

- name: Write the Galaxy token to ~/.ansible/galaxy_token
copy:
ansible.builtin.copy:
content: |
token: {{ lookup('env','ANSIBLE_GALAXY_TOKEN') }}
token: {{ lookup('env', 'ANSIBLE_GALAXY_TOKEN') }}
dest: ~/.ansible/galaxy_token
mode: "0644"

tasks:
- name: Template out the galaxy.yml file.
template:
ansible.builtin.template:
src: templates/galaxy.yml.j2
dest: ../galaxy.yml
mode: "0644"
register: galaxy_yml
- name: Build the collection. # noqa 503
command: >

- name: Build the collection. # noqa no-changed-when no-handler
ansible.builtin.command: >
ansible-galaxy collection build
chdir=../
when: galaxy_yml.changed
- name: Publish the collection. # noqa 503
command: >

- name: Publish the collection. # noqa no-changed-when no-handler
ansible.builtin.command: >
ansible-galaxy collection publish ./ericsysmin-kubernetes-{{ tag }}.tar.gz
chdir=../
when: galaxy_yml.changed
19 changes: 19 additions & 0 deletions changelogs/.plugin-cache.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
objects:
role: {}
plugins:
become: {}
cache: {}
callback: {}
cliconf: {}
connection: {}
filter: {}
httpapi: {}
inventory: {}
lookup: {}
module: {}
netconf: {}
shell: {}
strategy: {}
test: {}
vars: {}
version: 1.0.0
4 changes: 4 additions & 0 deletions changelogs/changelog.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
ancestor: null
releases:
1.0.0:
release_date: '2024-03-05'
34 changes: 34 additions & 0 deletions changelogs/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
changelog_filename_template: ../CHANGELOG.rst
changelog_filename_version_depth: 0
changes_file: changelog.yaml
changes_format: combined
ignore_other_fragment_extensions: true
keep_fragments: false
mention_ancestor: true
new_plugins_after_name: removed_features
notesdir: fragments
output_formats:
- rst
prelude_section_name: release_summary
prelude_section_title: Release Summary
sanitize_changelog: true
sections:
- - major_changes
- Major Changes
- - minor_changes
- Minor Changes
- - breaking_changes
- Breaking Changes / Porting Guide
- - deprecated_features
- Deprecated Features
- - removed_features
- Removed Features (previously deprecated)
- - security_fixes
- Security Fixes
- - bugfixes
- Bugfixes
- - known_issues
- Known Issues
title: Ericsysmin.Kubernetes
trivial_section_name: trivial
use_fqcn: true
46 changes: 2 additions & 44 deletions galaxy.yml
Original file line number Diff line number Diff line change
@@ -1,42 +1,13 @@
---
### REQUIRED

# The namespace of the collection. This can be a company/brand/organization or product namespace under which all
# content lives. May only contain alphanumeric lowercase characters and underscores. Namespaces cannot start with
# underscores or numbers and cannot contain consecutive underscores
# code: language=ansible
namespace: ericsysmin

# The name of the collection. Has the same character restrictions as 'namespace'
name: kubernetes

# The version of the collection. Must be compatible with semantic versioning
version: 0.1.0

# The path to the Markdown (.md) readme file. This path is relative to the root of the collection
version: 1.0.0
readme: README.md

# A list of the collection's content authors. Can be just the name or in the format 'Full Name <email> (url)
# @nicks:irc/im.site#channel'
authors:
- Eric Anderson <eric.sysmin@gmail.com> (https://ericsysmin.com)


### OPTIONAL but strongly recommended

# A short summary description of the collection
description: Collection of Kubernetes Roles

# Either a single license or a list of licenses for content inside of a collection. Ansible Galaxy currently only
# accepts L(SPDX,https://spdx.org/licenses/) licenses. This key is mutually exclusive with 'license_file'
# license:
# - GPL-2.0-or-later

# The path to the license file for the collection. This path is relative to the root of the collection. This key is
# mutually exclusive with 'license'
license_file: 'LICENSE'

# A list of tags you want to associate with the collection for indexing/searching. A tag name has the same character
# requirements as 'namespace' and 'name'
tags:
- kubernetes
- kubectl
Expand All @@ -46,21 +17,8 @@ tags:
- gke
- aks
- eks

# Collections that this collection requires to be installed for it to be usable. The key of the dict is the
# collection label 'namespace.name'. The value is a version range
# L(specifiers,https://python-semanticversion.readthedocs.io/en/latest/#requirement-specification). Multiple version
# range specifiers can be set and are separated by ','
dependencies: {}

# The URL of the originating SCM repository
repository: https://github.com/ericsysmin/ansible-collection-kubernetes

# The URL to any online docs
documentation: https://github.com/ericsysmin/ansible-collection-kubernetes

# The URL to the homepage of the collection/project
homepage: https://github.com/ericsysmin/ansible-collection-kubernetes

# The URL to the collection issue tracker
issues: https://github.com/ericsysmin/ansible-collection-kubernetes/issues
12 changes: 7 additions & 5 deletions molecule/kompose/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,21 @@
hosts: all
pre_tasks:
- name: Update package cache
package: update_cache=yes
ansible.builtin.package:
update_cache: "yes"
cmd: ""
changed_when: false
register: task_result
until: task_result is success
retries: 10
delay: 2
- name: create containerd folder
file:
- name: Create containerd folder
ansible.builtin.file:
path: /etc/systemd/system/containerd.service.d
state: directory
when: ansible_service_mgr == "systemd"
- name: override file for containerd
copy:
- name: Override file for containerd
ansible.builtin.copy:
src: files/override.conf
dest: /etc/systemd/system/containerd.service.d/override.conf
when: ansible_service_mgr == "systemd"
Expand Down
12 changes: 7 additions & 5 deletions molecule/kubectl/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,21 @@
hosts: all
pre_tasks:
- name: Update package cache
package: update_cache=yes
ansible.builtin.package:
update_cache: "yes"
cmd: ""
changed_when: false
register: task_result
until: task_result is success
retries: 10
delay: 2
- name: create containerd folder
file:
- name: Create containerd folder
ansible.builtin.file:
path: /etc/systemd/system/containerd.service.d
state: directory
when: ansible_service_mgr == "systemd"
- name: override file for containerd
copy:
- name: Override file for containerd
ansible.builtin.copy:
src: files/override.conf
dest: /etc/systemd/system/containerd.service.d/override.conf
when: ansible_service_mgr == "systemd"
Expand Down
1 change: 1 addition & 0 deletions roles/kompose/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
# code: language=ansible
# defaults file for kompose
kompose_version: 1.17.0
kompose_deb_url: https://github.com/kubernetes/kompose/releases/download/v{{ kompose_version }}/kompose_{{ kompose_version }}_amd64.deb
Expand Down
15 changes: 2 additions & 13 deletions roles/kompose/meta/main.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,12 @@
---
# code: language=ansible
galaxy_info:
author: ericsysmin
role_name: kompose
description: Role to install kompose on linux systems
company: Avi Networks
license: MIT
min_ansible_version: 2.4
platforms:
- name: EL
versions:
- 7
- name: Ubuntu
versions:
- trusty
- xenial
- bionic
- name: Debian
versions:
- stretch
min_ansible_version: "2.12"
galaxy_tags:
- kompose
- ubuntu
Expand Down
6 changes: 4 additions & 2 deletions roles/kompose/tasks/debian.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
- name: kompose | Debian | Install package from github
apt: deb={{ kompose_deb_url }}
# code: language=ansible
- name: Kompose | Debian | Install package from github
ansible.builtin.apt:
deb: "{{ kompose_deb_url }}"
register: task_result
until: task_result is success
retries: 10
Expand Down
Loading

0 comments on commit af3341b

Please sign in to comment.