Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ubuntu 16.04 support #3

Merged
6 commits merged into from Jul 18, 2017
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 9 additions & 3 deletions README.md
Expand Up @@ -30,12 +30,17 @@ bastion host setup scripts.

## Requirements

* Fresh CentOS 7 setup
* Fresh CentOS 7 or Ubuntu 16.04 setup
* [Ansible](http://docs.ansible.com/ansible/intro_installation.html) 2.3+ for
install or update

## INSTALL

for ubuntu only:
```
# apt update; apt install python python-pip python-dev -y
```

edit

`ansible/hosts.ini`
Expand All @@ -53,7 +58,7 @@ and restart server

append to

`/etc/bashrc`
`/etc/bashrc` or `/etc/bash.bashrc` for ubuntu:
```
if [ -f /opt/auth/shared/bash.sh ]; then
source /opt/auth/shared/bash.sh;
Expand Down Expand Up @@ -92,6 +97,7 @@ systemctl status sshd
```

### OTP

append to

`/etc/pam.d/sshd`
Expand Down Expand Up @@ -174,7 +180,7 @@ Persistent connection - for easy connection reopen without OTP and password prom

append to

`/etc/bashrc`
`/etc/bashrc` or `/etc/bash.bashrc` for ubuntu:
```
ISOLATE_BACKEND=redis; # or zabbix
export ISOLATE_BACKEND;
Expand Down
12 changes: 11 additions & 1 deletion ansible/main.yml
@@ -1,4 +1,14 @@
---
- name: Ubuntu 16.04 workarounds
gather_facts: no
connection: local
hosts: all
tasks:
- name: Installing Python...
shell: "ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -l root {{ ansible_ssh_host }} 'apt-get clean ; apt-get update ; apt-get -y install python python-dev python-pip python-simplejson'"
when: ubuntu_1604 | default(False)
tags: always

- name: Auth host setup...
gather_facts: yes
become_user: root
Expand All @@ -9,6 +19,6 @@

- role: auth
git_repo: https://github.com/itsumma/isolate.git
git_branch: master
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: fix

git_branch: develop
deploy_path: /opt/auth
tags: auth
4 changes: 2 additions & 2 deletions ansible/roles/auth/tasks/main.yml
Expand Up @@ -14,8 +14,8 @@
- pam2fa
- pam-2fa

- include: nginx.yml
tags: nginx
#- include: nginx.yml
# tags: nginx

- include: auth-deploy.yml
tags: auth-deploy
16 changes: 16 additions & 0 deletions ansible/roles/auth/tasks/pam-2fa.yml
Expand Up @@ -5,6 +5,22 @@
- liboath
- gen-oath-safe
- pam_oath
when: ansible_distribution == "CentOS"

- name: Ensure oath etc dir exist...
file: dest=/etc/oath state=directory owner=root group=root mode=0700
when: ansible_distribution == "CentOS"

#- apt_repository:
# repo: 'ppa:yubico/stable'
# when: ansible_distribution == "Ubuntu"
#
- name: Installing libpam-yubico from PPA...
apt: name={{ item }} state=present update_cache=yes
with_items:
- libpam-oath
- liboath0
- liboath-dev
- oathtool
when: ansible_distribution == "Ubuntu"

23 changes: 22 additions & 1 deletion ansible/roles/auth/tasks/redis.yml
Expand Up @@ -10,9 +10,30 @@
yum: name={{ item }} state=present update_cache=yes
with_items:
- redis
when: ansible_distribution == "CentOS"

- apt_repository:
repo: 'ppa:chris-lea/redis-server'
when: ansible_distribution == "Ubuntu"

- name: Install Redis via apt...
apt: name={{ item }} state=present update_cache=yes
with_items:
- redis-server
when: ansible_distribution == "Ubuntu"

- name: Apply Redis configs...
template: src=redis.conf dest=/etc/redis.conf owner=root group=redis mode=0640
template: src=redis_centos.conf dest=/etc/redis.conf owner=root group=redis mode=0640
when: ansible_distribution == "CentOS"

- name: Apply Redis configs...
template: src=redis_ubuntu.conf dest=/etc/redis/redis.conf owner=root group=redis mode=0640
when: ansible_distribution == "Ubuntu"

- name: Restart Redis...
service: name=redis state=restarted enabled=yes
when: ansible_distribution == "CentOS"

- name: Restart Redis...
systemd: daemon_reload=yes state=restarted name=redis-server enabled=yes
when: ansible_distribution == "Ubuntu"