Skip to content

Commit 09e8fb7

Browse files
committed
update role
1 parent 09718e7 commit 09e8fb7

File tree

12 files changed

+118
-82
lines changed

12 files changed

+118
-82
lines changed

.travis.yml

+21-34
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,35 @@
11
---
22
language: python
3-
python: "2.7"
4-
5-
# Use the new container infrastructure
6-
sudo: false
7-
8-
# Install ansible
9-
addons:
10-
apt:
11-
packages:
12-
- python-pip
3+
services: docker
4+
5+
env:
6+
global:
7+
- ROLE_NAME: motd
8+
matrix:
9+
- MOLECULE_DISTRO: centos7
10+
- MOLECULE_DISTRO: centos6
11+
- MOLECULE_DISTRO: ubuntu1804
12+
- MOLECULE_DISTRO: debian9
13+
- MOLECULE_DISTRO: debian10
1314

1415
install:
15-
# Install ansible
16-
- pip install ansible
17-
18-
# Install ansible-lint
19-
- pip install ansible-lint
20-
21-
# Install yamllint
22-
- pip install yamllint
16+
- pip install molecule docker
2317

24-
# Install tests rules
25-
- git submodule add https://github.com/arillso/tests tests
18+
- git clone https://github.com/arillso/tests molecule/default/lint
2619

2720
before_script:
28-
# Check ansible version
29-
- ansible --version
30-
31-
# Check ansible-lint version
32-
- ansible-lint --version
33-
34-
# Check ansible-lint version
35-
- yamllint --version
21+
- cd ../
22+
- mv ansible.$ROLE_NAME arillso.$ROLE_NAME
23+
- cd arillso.$ROLE_NAME
3624

3725
script:
38-
# Ansible Lint check
39-
- ansible-lint -R -r tests/ansible-lint/ .
40-
41-
# YAML Lint check
42-
- yamllint -c tests/yaml-lint/yamllint.yml .
26+
- molecule test
4327

4428
notifications:
45-
webhooks: https://galaxy.ansible.com/api/v1/notifications/
29+
webhooks:
30+
urls:
31+
- https://galaxy.ansible.com/api/v1/notifications/
32+
on_success: always
4633
email:
4734
on_success: never
4835
on_failure: always

CHANGELOG.md

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Changelog
2+
3+
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html)
4+
and [human-readable changelog](https://keepachangelog.com/en/1.0.0/).
5+
6+
## 1.3.0
7+
8+
### Changed
9+
10+
- Updated min ansible version to 2.9
11+
- Travis file has been updated
12+
13+
## 1.3.0
14+
15+
### Added
16+
17+
- add option exlude file system
18+
19+
## 1.2.0
20+
21+
### Added
22+
23+
- add debian Support
24+
25+
## 1.1.0
26+
27+
- add support for dynamic motd
28+
29+
## 1.0.0
30+
31+
### Added
32+
33+
- inital Release

LICENSE

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2017 Simon Bärlocher
1+
Copyright (c) 2020 Arillso
22

33
Permission is hereby granted, free of charge, to any person obtaining a copy
44
of this software and associated documentation files (the "Software"), to deal
@@ -16,4 +16,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1616
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1717
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1818
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19-
THE SOFTWARE.
19+
THE SOFTWARE.

README.md

+4-22
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Ansible Role: motd
22

3-
[![Build Status](https://travis-ci.org/arillso/ansible.motd.svg?branch=master)](https://travis-ci.org/arillso/ansible.motd) [![license](https://img.shields.io/github/license/mashape/apistatus.svg)](https://sbaerlo.ch/er/licence) [![Ansible Galaxy](http://img.shields.io/badge/ansible--galaxy-motd-blue.svg)](https://galaxy.ansible.com/arillso/motd)
3+
[![Build Status](https://img.shields.io/travis/arillso/ansible.motd.svg?branch=master&style=popout-square)](https://travis-ci.org/arillso/ansible.motd) [![license](https://img.shields.io/github/license/mashape/apistatus.svg?style=popout-square)](https://sbaerlo.ch/licence) [![Ansible Galaxy](https://img.shields.io/badge/ansible--galaxy-motd-blue.svg?style=popout-square)](https://galaxy.ansible.com/arillso/motd) [![Ansible Role](https://img.shields.io/ansible/role/d/21815.svg?style=popout-square)](https://galaxy.ansible.com/arillso/motd)
44

55
## Description
66

@@ -29,35 +29,17 @@ None
2929
```yml
3030
- hosts: all
3131
roles:
32-
- arillso.motd
32+
- arillso.motd
3333
```
3434
35-
## Changelog
36-
37-
### 1.3
38-
39-
* add option exlude file system
40-
41-
### 1.2
42-
43-
* add debian Support
44-
45-
### 1.1
46-
47-
* add support for dynamic motd
48-
49-
### 1.0
50-
51-
* inital role
52-
5335
## Author
5436
55-
* [Simon Bärlocher](https://sbaerlocher.ch)
37+
- [Simon Bärlocher](https://sbaerlocher.ch)
5638
5739
## License
5840
5941
This project is under the MIT License. See the [LICENSE](https://sbaerlo.ch/licence) file for the full license text.
6042
6143
## Copyright
6244
63-
(c) 2017, Simon Bärlocher
45+
(c) 2020, Simon Bärlocher

defaults/main.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
# defaults file for arillso.motd
33

4-
motd_ascii_art: |-2
4+
motd_ascii_art: |2-
55
_ _ _ _
66
/ \ _ __ ___(_) |__ | | ___
77
/ _ \ | '_ \/ __| | '_ \| |/ _ \

meta/main.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
2-
32
galaxy_info:
43
author: arillso
54
license: MIT
6-
min_ansible_version: 2
5+
description: Configuriet dynamic motd file on Ubuntu and Centos.
6+
min_ansible_version: 2.9
77
platforms:
88
- name: Debian
99
versions:

molecule/default/molecule.yml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
dependency:
3+
name: galaxy
4+
driver:
5+
name: docker
6+
lint:
7+
name: yamllint
8+
platforms:
9+
- name: instance
10+
image: 'geerlingguy/docker-${MOLECULE_DISTRO:-centos7}-ansible:latest'
11+
command: ${MOLECULE_DOCKER_COMMAND:-""}
12+
volumes:
13+
- /sys/fs/cgroup:/sys/fs/cgroup:ro
14+
privileged: true
15+
pre_build_image: true
16+
provisioner:
17+
name: ansible
18+
lint:
19+
name: ansible-lint
20+
playbooks:
21+
converge: ${MOLECULE_PLAYBOOK:-playbook.yml}
22+
scenario:
23+
name: default
24+
verifier:
25+
name: testinfra
26+
lint:
27+
name: flake8

molecule/default/playbook.yml

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
- name: Converge
3+
hosts: all
4+
roles:
5+
- role: arillso.motd

tasks/distribution/CentOS.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
# tasks file for arillso.motd
33

4-
- name: CentOS | configure motd
4+
- name: 'CentOS : configure motd'
55
become: true
66
template:
77
src: '{{ item }}.j2'
@@ -17,7 +17,7 @@
1717
tags:
1818
- configuration
1919

20-
- name: CentOS | configure ascii-logo
20+
- name: 'CentOS : configure ascii-logo'
2121
become: true
2222
copy:
2323
content: '{{ motd_ascii_art }}'

tasks/distribution/Debian.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
# tasks file for arillso.motd
33

4-
- name: Debian | configure motd
4+
- name: 'Debian : configure motd'
55
become: true
66
template:
77
src: '{{ item }}.j2'
@@ -17,7 +17,7 @@
1717
tags:
1818
- configuration
1919

20-
- name: Debian | configure ascii-logo
20+
- name: 'Debian : configure ascii-logo'
2121
become: true
2222
copy:
2323
content: '{{ motd_ascii_art }}'
@@ -28,7 +28,7 @@
2828
tags:
2929
- configuration
3030

31-
- name: Debian | remove motd
31+
- name: 'Debian : remove motd'
3232
become: true
3333
file:
3434
path: '{{ item }}'

tasks/distribution/Ubuntu.yml

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
---
22
# tasks file for arillso.motd
33

4-
- name: Ubuntu | install motd
4+
- name: 'Ubuntu : install motd'
55
become: true
66
package:
77
name: update-motd
88
tags:
99
- packages
1010

11-
- name: Ubuntu | configure motd
11+
- name: 'Ubuntu : configure motd'
1212
become: true
1313
template:
1414
src: '{{ item }}.j2'
@@ -31,7 +31,7 @@
3131
tags:
3232
- configuration
3333

34-
- name: Ubuntu | configure ascii-logo
34+
- name: 'Ubuntu : configure ascii-logo'
3535
become: true
3636
copy:
3737
content: '{{ motd_ascii_art }}'
@@ -42,13 +42,15 @@
4242
tags:
4343
- configuration
4444

45-
- name: Ubuntu | remove motd
45+
- name: 'Ubuntu : remove motd'
4646
become: true
4747
file:
4848
path: '/etc/update-motd.d/{{ item }}'
4949
state: absent
5050
with_items:
5151
- 10-help-text
5252
- 50-motd-news
53+
- 80-livepatch
54+
- 50-landscape-sysinfo
5355
- 51-cloudguest
5456
- 99-esm

tasks/main.yml

+12-12
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,31 @@
22
# tasks file for arillso.motd
33

44
- name: add OS specific variables
5-
include_vars: "{{ loop_vars }}"
5+
include_vars: '{{ loop_vars }}'
66
with_first_found:
77
- files:
8-
- "{{ ansible_distribution }}-{{ ansible_distribution_version }}.yml"
9-
- "{{ ansible_distribution }}.yml"
10-
- "{{ ansible_os_family }}.yml"
11-
- "defaults.yml"
8+
- '{{ ansible_distribution }}-{{ ansible_distribution_version }}.yml'
9+
- '{{ ansible_distribution }}.yml'
10+
- '{{ ansible_os_family }}.yml'
11+
- 'defaults.yml'
1212
paths:
13-
- "vars"
13+
- 'vars'
1414
loop_control:
1515
loop_var: loop_vars
1616
tags:
1717
- configuration
1818
- packages
1919

2020
- name: add distribution tasks
21-
include_tasks: "{{ loop_distribution }}"
21+
include_tasks: '{{ loop_distribution }}'
2222
with_first_found:
2323
- files:
24-
- "{{ ansible_distribution }}-{{ ansible_distribution_version }}.yml"
25-
- "{{ ansible_distribution }}.yml"
26-
- "{{ ansible_os_family }}.yml"
27-
- "defaults.yml"
24+
- '{{ ansible_distribution }}-{{ ansible_distribution_version }}.yml'
25+
- '{{ ansible_distribution }}.yml'
26+
- '{{ ansible_os_family }}.yml'
27+
- 'defaults.yml'
2828
paths:
29-
- "distribution"
29+
- 'distribution'
3030
loop_control:
3131
loop_var: loop_distribution
3232
tags:

0 commit comments

Comments
 (0)