Skip to content

Commit

Permalink
Merge pull request #10 from jobscore/chore/add_github_actions
Browse files Browse the repository at this point in the history
Add github actions
  • Loading branch information
GlauberrBatista authored Nov 30, 2023
2 parents 23433be + ec7a17c commit 1751539
Show file tree
Hide file tree
Showing 14 changed files with 689 additions and 589 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
name: CI
on:
push:
branches:
- master
pull_request:

jobs:
molecule:
name: Molecule
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Python 3
uses: actions/setup-python@v4
with:
python-version: '3.x'

- name: Install pipenv
run: pip3 install pipenv

- name: Create pipenv
run: pipenv install

- name: Run Molecule tests
run: pipenv run molecule test
env:
PY_COLORS: '1'
ANSIBLE_FORCE_COLOR: '1'
27 changes: 27 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
name: Release
on:
push:
tags:
- '*'

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Python 3
uses: actions/setup-python@v4
with:
python-version: '3.x'

- name: Install Ansible
run: pip3 install ansible-core

- name: Trigger a new import on Galaxy.
run: >-
ansible-galaxy role import --api-key ${{ secrets.GALAXY_API_KEY }}
$(echo ${{ github.repository }} | cut -d/ -f1) $(echo ${{ github.repository }} | cut -d/ -f2)
11 changes: 0 additions & 11 deletions .travis.yml

This file was deleted.

7 changes: 4 additions & 3 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ verify_ssl = true

[packages]
ansible = "*"
molecule = "*"
docker-py = "*"
molecule-docker = "*"
yamllint = "*"
'molecule-plugins[docker]' = "*"

[requires]
python_version = "2.7"
python_version = "3.12"
1,093 changes: 577 additions & 516 deletions Pipfile.lock

Large diffs are not rendered by default.

4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Postfix Sendgrid

[![Build Status](https://travis-ci.org/jobscore/ansible-role-postfix-sendgrid.svg?branch=master)](https://travis-ci.org/jobscore/ansible-role-postfix-sendgrid)

Ansible Role for configuring Postfix as a Sendgrid relay on Ubuntu

## Requirements
Expand All @@ -18,8 +16,6 @@ TBD
- hosts: servers
roles:
- role: jobscore.postfix_sendgrid


```
## License
Expand Down
8 changes: 5 additions & 3 deletions meta/main.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
---
galaxy_info:
author: Eric Magalhães
author: Eric Magalhães and Glauber Batista
description: Ansible Role for configuring Postfix as a Sendgrid relay on Ubuntu
company: JobScore Inc
license: license (MIT)
namespace: jobscore
role_name: postfix_sendgrid

min_ansible_version: 1.2
min_ansible_version: 2.10
platforms:
- name: Ubuntu
versions:
- bionic
- xenial
- focal
- jammy
galaxy_tags:
- ubuntu
- postfix
Expand Down
14 changes: 0 additions & 14 deletions molecule/default/Dockerfile.j2

This file was deleted.

16 changes: 0 additions & 16 deletions molecule/default/INSTALL.rst

This file was deleted.

File renamed without changes.
35 changes: 27 additions & 8 deletions molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,39 @@ dependency:
name: galaxy
driver:
name: docker
lint:
name: yamllint
lint: |
set -e
yamllint .
platforms:
- name: bionic
image: ubuntu:bionic
- name: xenial
image: ubuntu:xenial
image: geerlingguy/docker-ubuntu1804-ansible:latest
command: ${MOLECULE_DOCKER_COMMAND:-""}
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:rw
cgroupns_mode: host
privileged: true
pre_build_image: true
- name: focal
image: geerlingguy/docker-ubuntu2004-ansible:latest
command: ${MOLECULE_DOCKER_COMMAND:-""}
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:rw
cgroupns_mode: host
privileged: true
pre_build_image: true
- name: jammy
image: geerlingguy/docker-ubuntu2204-ansible:latest
command: ${MOLECULE_DOCKER_COMMAND:-""}
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:rw
cgroupns_mode: host
privileged: true
pre_build_image: true
provisioner:
name: ansible
lint:
name: ansible-lint
scenario:
name: default
verifier:
name: testinfra
lint:
name: flake8
name: ansible
14 changes: 0 additions & 14 deletions molecule/default/tests/test_default.py

This file was deleted.

15 changes: 15 additions & 0 deletions molecule/default/verify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
- hosts: all
roles:
- role: ansible-role-postfix-sendgrid
postfix_mailname: ubuntu
post_tasks:
- name: Check for postfix conf file
stat:
path: /etc/postfix/main.cf
register: postfix_conf_check

- name: Ensure postfix conf exists
fail:
msg: "The postfix conf file does not exist"
when: postfix_conf_check.stat.exists == False
1 change: 1 addition & 0 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
- mutt
- libsasl2-modules
- ssl-cert
update_cache: true

- name: Ensure that the mailname is configured
copy:
Expand Down

0 comments on commit 1751539

Please sign in to comment.