forked from malavolti/ansible-shibboleth
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
177 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,9 @@ | ||
--- | ||
# defaults file for memcached | ||
|
||
memcached_port: 11211 | ||
memcached_listen_ip: '0.0.0.0' | ||
memcached_memory_limit: 512M | ||
memcached_connections: 1024 | ||
memcached_log_file: /var/log/memcached.log | ||
memcached_log_verbosity: "-vv" |
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,9 @@ | ||
--- | ||
# handlers file for memcached | ||
|
||
- name: "Restart memcached" | ||
service: | ||
name: memcached | ||
state: restarted | ||
when: | ||
- not memcached_install.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,53 @@ | ||
galaxy_info: | ||
author: your name | ||
description: your description | ||
company: your company (optional) | ||
|
||
# If the issue tracker for your role is not on github, uncomment the | ||
# next line and provide a value | ||
# issue_tracker_url: http://example.com/issue/tracker | ||
|
||
# Choose a valid license ID from https://spdx.org - some suggested licenses: | ||
# - BSD-3-Clause (default) | ||
# - MIT | ||
# - GPL-2.0-or-later | ||
# - GPL-3.0-only | ||
# - Apache-2.0 | ||
# - CC-BY-4.0 | ||
license: license (GPL-2.0-or-later, MIT, etc) | ||
|
||
min_ansible_version: 2.4 | ||
|
||
# If this a Container Enabled role, provide the minimum Ansible Container version. | ||
# min_ansible_container_version: | ||
|
||
# | ||
# Provide a list of supported platforms, and for each platform a list of versions. | ||
# If you don't wish to enumerate all versions for a particular platform, use 'all'. | ||
# To view available platforms and versions (or releases), visit: | ||
# https://galaxy.ansible.com/api/v1/platforms/ | ||
# | ||
# platforms: | ||
# - name: Fedora | ||
# versions: | ||
# - all | ||
# - 25 | ||
# - name: SomePlatform | ||
# versions: | ||
# - all | ||
# - 1.0 | ||
# - 7 | ||
# - 99.99 | ||
|
||
galaxy_tags: [] | ||
# List tags for your role here, one per line. A tag is a keyword that describes | ||
# and categorizes the role. Users find roles by searching for tags. Be sure to | ||
# remove the '[]' above, if you add tags to this list. | ||
# | ||
# NOTE: A tag is limited to a single word comprised of alphanumeric characters. | ||
# Maximum 20 tags per role. | ||
|
||
dependencies: [] | ||
# List your role dependencies here, one per line. Be sure to remove the '[]' above, | ||
# if you add dependencies to this list. | ||
|
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 @@ | ||
--- | ||
# tasks file for memcached | ||
|
||
# Include variables and define needed variables. | ||
- name: Include OS-specific variables. | ||
include_vars: "{{ ansible_os_family }}.yml" | ||
tags: memcached | ||
|
||
- name: "Install Memcached" | ||
import_tasks: memcached-install.yml | ||
tags: memcached | ||
|
||
- name: "Configure Memcached" | ||
import_tasks: memcached-configure.yml | ||
tags: memcached |
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,16 @@ | ||
--- | ||
# Configure Memcached | ||
|
||
- name: "Define memcached_user" | ||
set_fact: | ||
memcached_user: "{{ __memcached_user }}" | ||
when: memcached_user is not defined | ||
|
||
- name: "Copy Memcached configuration" | ||
template: | ||
src: memcached-{{ ansible_os_family }}.conf.j2 | ||
dest: "{{ memcached_config_file }}" | ||
owner: "root" | ||
group: "root" | ||
mode: 0644 | ||
notify: "Restart memcached" |
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,19 @@ | ||
--- | ||
# Install tasks | ||
|
||
- name: "Run 'apt-get update' if the last one is more than 3600 seconds ago" | ||
apt: | ||
update_cache: yes | ||
cache_valid_time: 3600 | ||
|
||
- name: "Install Memcached" | ||
package: | ||
name: memcached | ||
state: present | ||
register: memcached_install | ||
|
||
- name: "Ensure Memcached is started and set to run on startup" | ||
service: | ||
name: memcached | ||
state: started | ||
enabled: yes |
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,43 @@ | ||
# {{ ansible_managed }} | ||
# memcached default config file | ||
# 2003 - Jay Bonci <jaybonci@debian.org> | ||
# This configuration file is read by the start-memcached script provided as | ||
# part of the Debian GNU/Linux distribution. | ||
|
||
# Run memcached as a daemon. This command is implied, and is not needed for the | ||
# daemon to run. See the README.Debian that comes with this package for more | ||
# information. | ||
-d | ||
|
||
# Log memcached's output to /var/log/memcached | ||
logfile {{ memcached_log_file }} | ||
{{ memcached_log_verbosity }} | ||
|
||
# Start with a cap of 64 megs of memory. It's reasonable, and the daemon default | ||
# Note that the daemon will grow to this size, but does not start out holding this much | ||
# memory | ||
-m {{ memcached_memory_limit }} | ||
|
||
# Default connection port is 11211 | ||
-p {{ memcached_port }} | ||
|
||
# Run the daemon as root. The start-memcached will default to running as root if no | ||
# -u command is present in this config file | ||
-u {{ memcached_user }} | ||
|
||
# Specify which IP address to listen on. The default is to listen on all IP addresses | ||
# This parameter is one of the only security measures that memcached has, so make sure | ||
# it's listening on a firewalled interface. | ||
-l {{ memcached_listen_ip }} | ||
|
||
# Limit the number of simultaneous incoming connections. The daemon default is 1024 | ||
-c {{ memcached_connections }} | ||
|
||
# Lock down all paged memory. Consult with the README and homepage before you do this | ||
# -k | ||
|
||
# Return error when memory is exhausted (rather than removing items) | ||
# -M | ||
|
||
# Maximize core file limit | ||
# -r |
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: | ||
- memcached |
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,4 @@ | ||
--- | ||
|
||
__memcached_user: memcache | ||
memcached_config_file: /etc/memcached.conf |
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 memcached |