-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
this role will depend on sssd_ad to bind to active directory It will then be used to manage sftp accounts
- Loading branch information
Showing
11 changed files
with
178 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
Role Name | ||
========= | ||
|
||
A brief description of the role goes here. | ||
|
||
Requirements | ||
------------ | ||
|
||
Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required. | ||
|
||
Role Variables | ||
-------------- | ||
|
||
A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well. | ||
|
||
Dependencies | ||
------------ | ||
|
||
A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles. | ||
|
||
Example Playbook | ||
---------------- | ||
|
||
Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too: | ||
|
||
- hosts: servers | ||
roles: | ||
- { role: username.rolename, x: 42 } | ||
|
||
License | ||
------- | ||
|
||
BSD | ||
|
||
Author Information | ||
------------------ | ||
|
||
An optional section for the role authors to include contact information, or a website (HTML is not allowed). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
# defaults file for sftp | ||
almasftp_user: "almasftp" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--- | ||
# handlers file for sftp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
galaxy_info: | ||
role_name: lib_sftp | ||
company: Princeton University Library | ||
description: Lib_SFTP | ||
author: pulibrary | ||
|
||
license: MIT | ||
|
||
min_ansible_version: 2.9 | ||
|
||
platforms: | ||
- name: Ubuntu | ||
versions: | ||
- jammy | ||
dependencies: | ||
- role: "common" | ||
- role: "deploy_user" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
- name: Converge | ||
hosts: all | ||
vars: | ||
- running_on_server: false | ||
become: true | ||
pre_tasks: | ||
- name: Update cache | ||
ansible.builtin.apt: | ||
update_cache: true | ||
cache_valid_time: 600 | ||
tasks: | ||
- name: "Include lib_sftp" | ||
ansible.builtin.include_role: | ||
name: lib_sftp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
scenario: | ||
name: default | ||
driver: | ||
name: docker | ||
lint: | | ||
set -e | ||
yamllint . | ||
ansible-lint | ||
platforms: | ||
- name: instance | ||
image: "ghcr.io/pulibrary/pul_containers:jammy_multi" | ||
command: "sleep infinity" | ||
volumes: | ||
- /sys/fs/cgroup:/sys/fs/cgroup:ro | ||
privileged: true | ||
pre_build_image: true | ||
provisioner: | ||
name: ansible | ||
log: true | ||
verifier: | ||
name: ansible |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
- name: Verify | ||
hosts: all | ||
gather_facts: false | ||
tasks: | ||
- name: Check ruby package status | ||
ansible.builtin.package: | ||
name: "{{ item }}" | ||
state: present | ||
check_mode: true | ||
register: pkg_status | ||
loop: | ||
- ruby-switch | ||
- ruby2.6-dev | ||
- ruby2.6 | ||
|
||
- name: Test for ruby packages | ||
ansible.builtin.assert: | ||
that: | ||
- not pkg_status.changed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
--- | ||
# tasks file for lib_sftp | ||
- name: Lib_sftp | create alma directory drop | ||
ansible.builtin.file: | ||
path: "{{ item }}" | ||
state: directory | ||
recurse: true | ||
owner: "{{ almasftp_user }}" | ||
group: "domain users@pu.win.princeton.edu" | ||
mode: "0755" | ||
loop: | ||
- "/alma/bursar" | ||
- "/alma/datasync_processing" | ||
- "/alma/fund_adjustment" | ||
- "/alma/invoice_status" | ||
- "/alma/invoices" | ||
- "/alma/people" | ||
- "/alma/pod" | ||
- "/alma/publishing" | ||
- "/alma/recap" | ||
- "/alma/scsb_renewals" | ||
|
||
- name: Lib_sftp | grant {{ deploy_user }} access to alma directory | ||
ansible.builtin.user: | ||
name: "{{ deploy_user }}" | ||
group: "domain users@pu.win.princeton.edu" | ||
append: true | ||
|
||
- name: Lib_sftp | create aspace directory drop | ||
ansible.builtin.file: | ||
path: /alma/aspace | ||
state: directory | ||
recurse: true | ||
owner: "{{ aspaceftp_user }}" | ||
group: "domain users@pu.win.princeton.edu" | ||
mode: "0755" | ||
|
||
- name: Lib_sftp | create local group for alma | ||
ansible.builtin.group: | ||
name: "domain users@pu.win.princeton.edu" | ||
state: present | ||
|
||
- name: Lib_sftp | create local user for alma | ||
ansible.builtin.user: | ||
name: almasftp | ||
shell: /usr/bin/bash | ||
group: "domain users@pu.win.princeton.edu" | ||
password: "{{ almasftp_user_password }}" | ||
|
||
- name: Lib_sftp | Flush handlers to be able to use SSSD authentication | ||
ansible.builtin.meta: flush_handlers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
localhost | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
- hosts: localhost | ||
remote_user: root | ||
roles: | ||
- sftp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--- | ||
# vars file for sftp |