Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
Version 1.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
sbaerlocher committed Jan 7, 2020
2 parents 2bb9f62 + 3533ea4 commit fa8d317
Show file tree
Hide file tree
Showing 11 changed files with 331 additions and 152 deletions.
56 changes: 22 additions & 34 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,48 +1,36 @@
---
language: python
python: "2.7"

# Use the new container infrastructure
sudo: false

# Install ansible
addons:
apt:
packages:
- python-pip
services: docker

env:
global:
- ROLE_NAME: users
matrix:
- MOLECULE_DISTRO: centos7
- MOLECULE_DISTRO: centos6
- MOLECULE_DISTRO: ubuntu1804
- MOLECULE_DISTRO: debian9
- MOLECULE_DISTRO: debian10
- MOLECULE_DISTRO: fedora29

install:
# Install ansible
- pip install ansible

# Install ansible-lint
- pip install ansible-lint

# Install yamllint
- pip install yamllint
- pip install molecule docker

# Install tests rules
- git submodule add https://github.com/arillso/tests tests
- 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 arillso.$ROLE_NAME
- cd arillso.$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
54 changes: 54 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Changelog

This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html)
and [human-readable changelog](https://keepachangelog.com/en/1.0.0/).

## 1.4.1

### Changed

- update min ansible version to 2.8
- moved changelog from readme
- travis file has been updated
- Documentation has been improved
- change var `users_host_vars` to `users_list_host`
- change var `users_group_vars` to `users_list_group`

### Added

- molecule testing

## 1.4.0

### Removed

- remove become in Windows

## 1.3.0

### Added

- add support for users on group and host vars layer
- add support no log when password or key then aktive no log

## 1.2.0

### Fixed

- fix lint

### Added

- new strucktur

## 1.1

### Added

- add windows support

## 1.0.0

### Added

- Initial release
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2016 Simon Bärlocher
Copyright (c) 2020 Arillso

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand All @@ -16,4 +16,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
THE SOFTWARE.
132 changes: 99 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Ansible Role: users

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

## Description

Expand All @@ -18,62 +18,128 @@ None

## Role Variables

| Variable | Default | Comments (type) |
| :--- | :--- | :--- |
| users | [] | list of users to add, See defaults |
| users_host_vars | [] | list of users to add by host vars, See users |
| users_group_vars | [] | list of users to add by group vars, See users |
| users_home | /home | users home directory |
| users_home_mode | "0755" | default user's home directory permissions |
| users_ssh_key_type | rsa | default user's ssh key type |
| users_ssh_key_bits | 2048 | default user's ssh key bits |
| users_authorized_keys_exclusive | no | default user's setting for authorized keys exclusive |
### Users

## Dependencies
list of users to add

None
```yml
users: []
```
## Example Playbook
```yml
list of users to add by host vars
users_list_host: []
```
list of users to add by group vars
```yml
- hosts: all
roles:
- arillso.users
users_list_group: []
```
#### Example
```yml
users:
- username: foobar (required)
name: Foo Bar
uid: 1000
group: staff
password: xxxxx (a hash created with: mkpasswd)
groups: ["adm", "www-data"]
append: no (only append groups, leave others)
home_mode: "0750"
home_create: yes
home: /path/to/user/home
system: no
authorized_keys: []
authorized_keys_exclusive: yes
ssh_key_type: rsa
ssh_key_bits: 2048
ssh_key_password: ""
ssh_key_generate: no
ssh_key: "xxx"
shell: /bin/bash
update_password: always

```

```yml
users:
- username: foobar (required)
name: Foo Bar
description: User
password: xxxxx
groups: ['adm', 'www-data']
hide: true
```
users home directory
```yml
users_home: /home
```
default user's primary group for users
```yml
users_group:
```
default user's secondary groups
```yml
users_groups: []
```
## Changelog
default user's home directory permissions
### 1.4
```yml
users_home_mode: '0755'
```
default user's ssh key type
* remove become in Windows
```yml
users_ssh_key_type: rsa
```
### 1.3
default user's ssh key bits
* add support for users on group and host vars layer
* add support no log when password or key then aktive no log
```yml
users_ssh_key_bits: 2048
```
### 1.2
default user's setting for authorized keys exclusive
* fix lint
* new strucktur
```yml
users_authorized_keys_exclusive: 'no'
```
### 1.1
## Dependencies
* add windows support
None
### 1.0
## Example Playbook
* Initial release
```yml
- hosts: all
roles:
- arillso.users
```
## Author
* [Simon Bärlocher](https://sbaerlocher.ch)
* We Are Interactive
- [Simon Bärlocher](https://sbaerlocher.ch)
## Inspiration
- [We Are Interactive](https://github.com/weareinteractive/ansible-users)
## License
This project is under the MIT License. See the [LICENSE](https://sbaerlo.ch/licence) file for the full license text.
## Copyright
(c) 2017, Simon Bärlocher
(c) 2020, Arillso
8 changes: 4 additions & 4 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,20 @@
# list of users to add
users: []
# list of users to add by host vars
users_host_vars: []
users_list_host: []
# list of users to add by group vars
users_group_vars: []
users_list_group: []
# users home directory
users_home: /home
# default user's primary group for users
users_group:
# default user's secondary groups
users_groups: []
# default user's home directory permissions
users_home_mode: "0755"
users_home_mode: '0755'
# default user's ssh key type
users_ssh_key_type: rsa
# default user's ssh key bits
users_ssh_key_bits: 2048
# default user's setting for authorized keys exclusive
users_authorized_keys_exclusive: no
users_authorized_keys_exclusive: 'no'
29 changes: 17 additions & 12 deletions meta/main.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,31 @@
---

galaxy_info:
author: arillso
description: This is an Ansible role which users and user's authorized keys manages on Linux and Windows.
description: Role to manage users on Linux and Windows.
license: MIT
min_ansible_version: 2
min_ansible_version: 2.9
platforms:
- name: Debian
versions:
- wheezy
- jessie
- stretch
- name: Ubuntu
versions:
- trusty
- xenial
- name: EL
versions:
- 6
- 7
- name: Fedora
versions:
- 29
- name: Ubuntu
versions:
- bionic
- cosmic
- name: Debian
versions:
- jessie
- stretch
- buster
- name: Windows
versions:
- all

galaxy_tags:
- system
- users
- user
Loading

0 comments on commit fa8d317

Please sign in to comment.