Skip to content

Commit

Permalink
Merge pull request #22 from sbaerlocher/fixed/many
Browse files Browse the repository at this point in the history
fixed
  • Loading branch information
sbaerlocher authored Sep 21, 2020
2 parents cf063e1 + 9b05e37 commit d202875
Show file tree
Hide file tree
Showing 6 changed files with 94 additions and 83 deletions.
51 changes: 17 additions & 34 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,48 +1,31 @@
---
language: python
python: "2.7"
services: docker

# Use the new container infrastructure
sudo: false

# Install ansible
addons:
apt:
packages:
- python-pip
env:
global:
- ROLE_NAME: snmp
matrix:
- MOLECULE_DISTRO: centos6
- MOLECULE_DISTRO: debian10

install:
# Install ansible
- pip install ansible

# Install ansible-lint
- pip install ansible-lint

# Install yamllint
- pip install yamllint

# Install tests rules
- git submodule add https://github.com/arillso/tests tests
- pip install docker molecule yamllint ansible-lint flake8
- git clone https://github.com/arillso/tests molecule/default/lint

before_script:
# Check ansible version
- ansible --version

# Check ansible-lint version
- ansible-lint --version

# Check ansible-lint version
- yamllint --version
- cd ../
- mv ansible.$ROLE_NAME sbaerlocher.$ROLE_NAME
- cd sbaerlocher.$ROLE_NAME

script:
# Ansible Lint check
- ansible-lint -R -r tests/ansible-lint/ .

# YAML Lint check
- yamllint -c tests/yaml-lint/yamllint.yml .
- molecule test

notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/
webhooks:
urls:
- https://galaxy.ansible.com/api/v1/notifications/
on_success: always
email:
on_success: never
on_failure: always
60 changes: 32 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Ansible Role: SNMP

[![Build Status](https://img.shields.io/travis/sbaerlocher/ansible.snmp.svg?branch=master&style=popout-square)](https://travis-ci.org/sbaerlocher/ansible.snmp) [![license](https://img.shields.io/github/license/mashape/apistatus.svg?style=popout-square)](https://sbaerlo.ch/licence) [![Ansible Galaxy](http://img.shields.io/badge/ansible--galaxy-snmp-blue.svg?style=popout-square)](https://galaxy.ansible.com/sbaerlocher/snmp) [![Ansible Role](https://img.shields.io/ansible/role/d/9234.svg?style=popout-square)](https://galaxy.ansible.com/sbaerlocher/snmp)
[![Build Status](https://img.shields.io/travis/sbaerlocher/ansible.snmp.svg?branch=master&style=popout-square)](https://travis-ci.org/sbaerlocher/ansible.snmp) [![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-snmp-blue.svg?style=popout-square)](https://galaxy.ansible.com/sbaerlocher/snmp) [![Ansible Role](https://img.shields.io/ansible/role/d/9234.svg?style=popout-square)](https://galaxy.ansible.com/sbaerlocher/snmp)

## Description

Expand All @@ -16,16 +16,16 @@ ansible-galaxy install sbaerlocher.snmp

## Role Variables

| Variable | Default | Comments (type) |
| :--- | :--- | :--- |
| snmp_user | snmp | SNMP User |
| snmp_password | snmp_password | SNMP Password |
| snmp_encryption | snmp_encryption | SNMP Encryption |
| snmp_contact | | Optional: System Contact |
| snmp_location | | Optional: System Location |
| snmp_agentadress_protocol.ipvX | udp / udp6 | Optional: SNMP Protocol, X for ipv4 or ipv6
| snmp_agentadress_adress.ipvX | {{ ansible_default_ipv4.address }} / {{ ansible_default_ipv6.address }} | Optional: SNMP bind address, X for ipv4 or ipv6 |
| snmp_agentadress_port.ipvX | 161 / 161 | Optional: SNMP port, X for ipv4 or ipv6 |
| Variable | Default | Comments (type) |
| :----------------------------- | :---------------------------------------------------------------------- | :---------------------------------------------- |
| snmp_user | snmp | SNMP User |
| snmp_password | snmp_password | SNMP Password |
| snmp_encryption | snmp_encryption | SNMP Encryption |
| snmp_contact | | Optional: System Contact |
| snmp_location | | Optional: System Location |
| snmp_agentadress_protocol.ipvX | udp / udp6 | Optional: SNMP Protocol, X for ipv4 or ipv6 |
| snmp_agentadress_adress.ipvX | {{ ansible_default_ipv4.address }} / {{ ansible_default_ipv6.address }} | Optional: SNMP bind address, X for ipv4 or ipv6 |
| snmp_agentadress_port.ipvX | 161 / 161 | Optional: SNMP port, X for ipv4 or ipv6 |

## Dependencies

Expand All @@ -36,56 +36,60 @@ None
```yml
- hosts: all
roles:
- sbaerlocher.snmp
- sbaerlocher.snmp
```
## Changelog
### 1.8.0
- add snmp install via module
### 1.7.1
* add support for Windows 1809
- add support for Windows 1809
### 1.7.0
* add osupdate support
* syntax cleaned up
- add osupdate support
- syntax cleaned up
### 1.6.0
* add distro support
* syntax cleaned up
* proxmox support
- add distro support
- syntax cleaned up
- proxmox support
### 1.5
* add Windows Support
- add Windows Support
### 1.4
* add IP bind support
- add IP bind support
### 1.3
* add become support
* new role check
* support for sysContact and sysLocation
- add become support
- new role check
- support for sysContact and sysLocation
### 1.2
* add package manager for generic OS
* cleanup
- add package manager for generic OS
- cleanup
### 1.1
* add ArchLinux support
- add ArchLinux support
### 1.0
* Initial release
- Initial release
## Author
* [Simon Bärlocher](https://sbaerlocher.ch)
- [Simon Bärlocher](https://sbaerlocher.ch)
## License
Expand Down
27 changes: 27 additions & 0 deletions molecule/default/molecule.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
dependency:
name: galaxy
driver:
name: docker
lint: |
set -e
yamllint . -c molecule/default/yamllint.yml
platforms:
- name: instance
image: 'geerlingguy/docker-${MOLECULE_DISTRO:-centos7}-ansible:latest'
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
privileged: true
pre_build_image: true
provisioner:
name: ansible
lint:
name: ansible-lint
playbooks:
converge: ${MOLECULE_PLAYBOOK:-playbook.yml}
scenario:
name: default
verifier:
name: testinfra
lint:
name: flake8
5 changes: 5 additions & 0 deletions molecule/default/playbook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
- name: Converge
hosts: all
roles:
- role: sbaerlocher.snmp
5 changes: 5 additions & 0 deletions molecule/default/yamllint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
extends: default
rules:
line-length: disable
comments: disable
Original file line number Diff line number Diff line change
@@ -1,25 +1,12 @@
---
# tasks file for sbaerlocher.snmp

# https://getadmx.com/?Category=Windows_10_2016&Policy=Microsoft.Policies.Servicing::Servicing
# https://www.zueschen.eu/windows-10-version-1809-rsat-tools-installation-schlaegt-fehl/
- name: 'windows : Specify settings for optional component installation and component repair'
win_regedit:
path: 'HKLM:\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Servicing'
name: '{{ item.name }}'
type: '{{ item.type }}'
data: '{{ item.data }}'
state: absent
with_items:
- name: 'RepairContentServerSource'
type: 'dword'
data: '2'
- name: 'LocalSourcePath'
type: 'expandstring'
data: ''

# - name: 'windows : install SNMP'
# win_shell: Add-WindowsCapability -Online -Name 'SNMP.Client~~~~0.0.1.0'
- name: 'Windows : Install SNMP Client'
become_method: runas
become_user: System
become: yes
sbaerlocher.windows.win_capability:
name: 'SNMP.Client~~~~0.0.1.0'

- name: 'windows : setting SNMP'
win_regedit:
Expand All @@ -44,8 +31,8 @@
name: '{{ snmp_community | default() }}'
type: dword
data: '4'
# notify:
# - restart win snmp
notify:
- restart win snmp

- name: 'windows : set remote IP-Adresss'
set_fact:
Expand Down

0 comments on commit d202875

Please sign in to comment.