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

Devel #136

Merged
merged 62 commits into from
Oct 29, 2019
Merged

Devel #136

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
a462fc0
general updates mainly to security settings, redirects
sashakames Jul 17, 2019
11b527d
Install on include the ModSecurity library and core rule set (CRS)
nathanlcarlson Jul 19, 2019
46fc14f
Merge pull request #115 from sashakames/httpd-update
nathanlcarlson Jul 19, 2019
6f4ac98
Merge pull request #116 from ESGF/http_sec
nathanlcarlson Jul 19, 2019
c75c5c0
update and add
sashakames Jul 19, 2019
3b6a796
Create our own mod security config file with rule exclusions
nathanlcarlson Jul 23, 2019
e9ef826
Merge pull request #117 from ESGF/http_sec
nathanlcarlson Jul 23, 2019
3ef5e00
Correct the path to the config file
nathanlcarlson Jul 25, 2019
47da9dd
Ensure tasks are correctly tagged
nathanlcarlson Jul 29, 2019
74262c0
add table and ref
sashakames Jul 29, 2019
94ffafa
Update the table with content (hit save in editor).
sashakames Jul 29, 2019
0e3186d
Display Solr shard information
nathanlcarlson Jul 31, 2019
881ebc8
Merge pull request #118 from sashakames/node-status
nathanlcarlson Jul 31, 2019
30f95ce
Create SLCS user to resolve #119
nathanlcarlson Aug 1, 2019
972b6b0
Temporarily disable mod security for testing
nathanlcarlson Aug 1, 2019
f7445e0
Merge branch 'devel' of https://github.com/ESGF/esgf-ansible into devel
nathanlcarlson Aug 1, 2019
1945914
add to index, complete table
Aug 1, 2019
df4c1c8
add to index, complete table
sashakames Aug 1, 2019
de40d47
fix table formatting for cells with 2 lines
sashakames Aug 1, 2019
4d2331a
fix table formatting for cells with 2 lines
sashakames Aug 1, 2019
e81ca6e
typo
sashakames Aug 1, 2019
79dbfbb
Set proper group permissions for myproxy CA files
nathanlcarlson Aug 1, 2019
4a3230c
Ensure CoG is only included if this is data only
nathanlcarlson Aug 1, 2019
73a160e
Add a robots.txt to avoid crawling data and orp paths
nathanlcarlson Aug 1, 2019
cb12b9c
Merge pull request #121 from sashakames/ska-docs
nathanlcarlson Aug 2, 2019
a99709c
Test using mod_security again
nathanlcarlson Aug 5, 2019
a389026
Merge branch 'devel' of https://github.com/ESGF/esgf-ansible into devel
nathanlcarlson Aug 5, 2019
172e1eb
before trying to start Solr, first check that it isn't already running
alaniwi Aug 6, 2019
c7a07a4
Remove syntax error in conditional
nathanlcarlson Aug 12, 2019
e947104
fix table (web certs)
sashakames Aug 12, 2019
e6deed7
inital of a developers guide starting with mod_wsgi express howto
sashakames Aug 23, 2019
bec7e50
add a link to TOC
sashakames Aug 26, 2019
4db388d
Merge pull request #125 from cedadev/start_solr_check_running
nathanlcarlson Sep 13, 2019
86a4e0a
Upgrade to latest Tomcat 8.5
nathanlcarlson Sep 30, 2019
98fb09e
update and corrections
sashakames Sep 30, 2019
55132e9
Merge pull request #123 from sashakames/ska-docs
nathanlcarlson Sep 30, 2019
941a666
Update esg-search to latest version
nathanlcarlson Oct 2, 2019
9f8b650
Update docs for 4.0.5 release
nathanlcarlson Oct 2, 2019
38f80b5
update version tags
sashakames Oct 2, 2019
84b84b2
Merge pull request #131 from sashakames/update-4.0.5
nathanlcarlson Oct 3, 2019
5ce49cb
Remove deployment of deprecated globusonline library
nathanlcarlson Oct 3, 2019
990f00e
Properly resolve dependencies for esgf-pub env
nathanlcarlson Oct 4, 2019
3be8d5c
Ensure cdtime is present in the publisher env
nathanlcarlson Oct 4, 2019
a31b2cc
Pin cdms package versions
nathanlcarlson Oct 4, 2019
e6c24e6
Only install globus tools if user specifies globus credentials
nathanlcarlson Oct 4, 2019
157f6c6
Continue to make corrections to esgf-pub env
nathanlcarlson Oct 4, 2019
3f26709
Use SHA-256 hash for tomcat user password
nathanlcarlson Oct 4, 2019
ecf7355
Digest the thredds password using the tomcat digest tool
nathanlcarlson Oct 7, 2019
4d3654f
Ensure cdms2 comes from conda
nathanlcarlson Oct 7, 2019
13711bd
Upgrade to ACME v2 since v1 is EOL
nathanlcarlson Oct 11, 2019
7e93d7e
Upgrade CoG version
sashakames Oct 18, 2019
f7d0a34
Merge pull request #133 from ESGF/upgrade-cog
nathanlcarlson Oct 21, 2019
fe4282e
update environment for psycopg2 v2.7.7 needed for unicode error
sashakames Oct 21, 2019
edd8dc9
Merge branch 'devel' into update-env
sashakames Oct 24, 2019
002aac1
Merge pull request #134 from sashakames/update-env
nathanlcarlson Oct 24, 2019
cb5d466
Ensure Solr template files are available when shards are added
nathanlcarlson Oct 24, 2019
7b6b3ac
Reinstate Globus transfer
nathanlcarlson Oct 24, 2019
39bc0c3
Merge branch 'devel' of https://github.com/ESGF/esgf-ansible into devel
nathanlcarlson Oct 24, 2019
b14dd4c
Use repaired version of CoG
nathanlcarlson Oct 24, 2019
62f8071
Update publisher to repaired version
nathanlcarlson Oct 25, 2019
d572849
Ensure versions are compatabile in the pub env
nathanlcarlson Oct 25, 2019
85d6e55
Update docs to reflect 4.0.5 release
nathanlcarlson Oct 28, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
author = u'LLNL ESGF Installer Working Team'

# The short X.Y version
version = u'4.0.4'
version = u'4.0.5'
# The full version, including alpha/beta/rc tags
release = u''

Expand Down
6 changes: 3 additions & 3 deletions docs/source/config/config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,16 @@ Regardless of Node type (data-only, index/idp, all, etc.) all three groups, ``da
In the case of data-only this means another site's index/idp host(s) must be assigned to their respective group.


See the sample inventory file, `sample.hosts <https://github.com/ESGF/esgf-ansible/blob/4.0.4/sample.hosts>`_ for more information regarding inventory files.
See the sample inventory file, `sample.hosts <https://github.com/ESGF/esgf-ansible/blob/4.0.5/sample.hosts>`_ for more information regarding inventory files.

Host Variable Files
-------------------

The host variable file provides an interface that allows users to configure common options for their deployments.
It is automatically detected for each managed machine and must be named ``host_vars/[hostname].yml`` where ``[hostname]`` is the hostname of each managed machine.
Options regarding certificates and keys for various services require the most attention as certain requirements have been placed on these variables.
See the host variables directory, `host_vars <https://github.com/ESGF/esgf-ansible/blob/4.0.4/host_vars>`_, and find the sample file
See the host variables directory, `host_vars <https://github.com/ESGF/esgf-ansible/blob/4.0.5/host_vars>`_, and find the sample file
that best describes the desired use case.
Also see the sample host variable file, `host_vars/myhost.my.org.yml <https://github.com/ESGF/esgf-ansible/blob/4.0.4/host_vars/myhost.my.org.yml>`_ for a comprehensive overview.
Also see the sample host variable file, `host_vars/myhost.my.org.yml <https://github.com/ESGF/esgf-ansible/blob/4.0.5/host_vars/myhost.my.org.yml>`_ for a comprehensive overview.
Advanced users may want to make configuration choices beyond what is provided in the host variable file
, see the `Contributing Guide <https://github.com/ESGF/esgf-ansible#advice-and-contributing>`_ for more information on this.
53 changes: 53 additions & 0 deletions docs/source/developers/developers.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
Developers Guide
================

Adding WSGI services to an ESGF node
------------------------------------

It's easy to add new services developed with Flask, Django, etc. and proxy using the esgf-httpd configuration and mod_wsgi express.

This guide assumes you have set up a project using flask at the example location ``/opt/esgf/flaskdemo/demo`` and you have the application entry point accessible in the ``/opt/esgf/flaskdemo/demo.wsgi``. Your demo app must world-readable and recommended to be owned by the ``apache`` user and group. These instructions assume to be run by a root user, as many server configs disallow a shell run under the apache user, but a regular user can be used to run the service for testing purposes.

- Create and activate a conda environment to run your webapp.

.. code:: console

source /usr/local/conda/bin/activate
conda create -n flaskdemo
conda activate flaskdemo

.. note::
if your app was developed in Python 2.7 you'll need to create the environment with the following instead:

.. code:: console

conda create -n flaskdemo 'python<3.0'

- Install modules needed to run your app. Our demo uses flask, but you could use django (and expect additional required packages.) Note that diffculty has been encountered with mod_wsgi version 4.6.7, so we recommend an earlier version:

.. code:: console

pip install flask 'mod_wsgi<4.6'

- Run the `mod_wsgi-express` command to create a httpd service instance for your webapp and start the instance.

.. code:: console

cd /opt/esgf/flaskdemo/demo
mod_wsgi-express setup-server --server-root /etc/wsgi-demo --user apache --group apache --host localhost --port 8087 --mount-point /demo demo.wsgi
/etc/wsgi-demo/apachectl start

- You should be able to access the demo now under ``http://localhost:8087/demo`` using ``curl`` or ``wget``.

- For external access on 443 for https, add the following directives to `/etc/httpd/conf/httpd.ssl.conf`:

.. code:: console

ProxyPass /demo http://localhost:8087/demo
ProxyPassReverse /demo http://localhost:8087/demo

- Restart httpd

- If you want the site available also on 80 for old insecure http, you can add the same directives to ``/etc/httpd/conf/esgf-httpd.conf``. In addition you need to add a rule to exempt ``/demo`` from the automatic redirection of http traffic to https as done for several of the ESGF Tomcat webapps that are proxied in that section.


45 changes: 45 additions & 0 deletions docs/source/faq/comptable.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
Comparison of ESGF v2 vs v4
===========================

In the following table, if no context given, items in the table in the v2 column are the command line flag to the `esg-node` script. Items in the v4 column are a playbook .yml file

+--------------------------+------------------------+------------------------------+
| Action or Location | ESGF v2 (Bash scripts) | ESGF v4 (Ansible) |
+==========================+========================+==============================+
| CoG location | NA (mod_wsgi in httpd) | /etc/cog-wsgi-8889 |
+--------------------------+------------------------+------------------------------+
| SLCS | NA (mod_wsgi in httpd) | /etc/slcs-wsgi-8888 |
+--------------------------+------------------------+------------------------------+
| Tomcat control | esg-node function | catalina.sh |
+--------------------------+------------------------+------------------------------+
| Solr index location | /esg/solr-index | /usr/local/solr-home |
+--------------------------+------------------------+------------------------------+
| Bootstrap | - wget esg-bootstrap | - (No bootstrap) |
| | - ./esg-bootstrap | - git clone esgf-ansible |
+--------------------------+------------------------+------------------------------+
| Configuration | esg-autoinstall.conf | inventory file |
| (auto-installation) | | host variables files |
+--------------------------+------------------------+------------------------------+
| Install latest | --install (--upgrade) | install.yml |
| ESGF version | | |
+--------------------------+------------------------+------------------------------+
| CSR | --generate-esgf-csrs | local_certs.yml |
+--------------------------+------------------------+------------------------------+
| Certs / CA | --update-temp-ca | local_certs.yml |
+--------------------------+------------------------+------------------------------+
| Stop | --stop | stop.yml |
+--------------------------+------------------------+------------------------------+
| Start | --start | start.yml |
+--------------------------+------------------------+------------------------------+
| Restart | --restart | stop.yml + start.yml |
+--------------------------+------------------------+------------------------------+
| Status | --status | status.yml |
+--------------------------+------------------------+------------------------------+
| Certificate Installation | - --install-local-certs| local_certs.yml |
+--------------------------+------------------------+------------------------------+
| (Web) | - --install-keypair | web_certs.yml |
+--------------------------+------------------------+------------------------------+
| LetsEncrypt request | NA | install.yml (tryletsencript) |
+--------------------------+------------------------+------------------------------+
| Shard Replicas | --add-replica-shard | shards.yml |
+--------------------------+------------------------+------------------------------+
7 changes: 6 additions & 1 deletion docs/source/faq/faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,9 @@ Some tasks can take several minutes to complete. Make sure the verbose flag is s
This second case could be things such as bad SSH authentication, a temporary network issue, an issue with the machine being deployed to,
or a variable improperly specified in the host variables file.
In this second case, attempt to determine and resolve the error, then start the deployment again.
If it is confidently determined be the first case, please `submit an issue <https://github.com/ESGF/esgf-ansible/issues/new/choose>`_ to this repository.

If it is confidently determined be the first case, please `submit an issue <https://github.com/ESGF/esgf-ansible/issues/new/choose>`_ to this repository.

**Q: I'm familiar with funcitonality in ESGF v2 using the bash script ``esg-node``, eg. starting, stopping the node, requesting certificates. How can I do that now with ESGF Ansible?

**Answer:** Please consult the following table that outlines the equivalent functions from ESGF v2 and v4: `Comparison of ESGF Versions <comptable.html>`_
2 changes: 2 additions & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ Welcome to ESGF-Ansible's documentation!
verify/verify.rst
whatsnew/whatsnew.rst
faq/faq.rst
faq/comptable.rst
developers/developers.rst

Indices and tables
==================
Expand Down
4 changes: 2 additions & 2 deletions docs/source/setup/setup.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ Setup

These steps describe how to setup the control machine. SSH access to the managed machine(s) is the responsibility of the user.

1. Clone the esgf-ansible repo at the current version, for example version 4.0.4 ::
1. Clone the esgf-ansible repo at the current version, for example version 4.0.5 ::

git clone --branch 4.0.4 https://github.com/ESGF/esgf-ansible.git && cd esgf-ansible
git clone --branch 4.0.5 https://github.com/ESGF/esgf-ansible.git && cd esgf-ansible

2. (Optional, but strongly recommended) Create a Python environment, using a tool like ``virtualenv`` or ``conda``, and activate the environment.

Expand Down
10 changes: 5 additions & 5 deletions docs/source/usage/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Inventory Files
This file specifies the managed machines.
It is specified at the command line via ``-i [inventory file name]``.

See the sample inventory file, `sample.hosts <https://github.com/ESGF/esgf-ansible/blob/4.0.4/sample.hosts>`_ for more information.
See the sample inventory file, `sample.hosts <https://github.com/ESGF/esgf-ansible/blob/4.0.5/sample.hosts>`_ for more information.

Also, see `Ansible's Inventory Info <https://docs.ansible.com/ansible/latest/user_guide/intro_inventory.html>`_.

Expand All @@ -20,9 +20,9 @@ Host Variable Files
These files specify options for each managed machine.
It is automatically detected for each managed machine and must be named ``host_vars/[hostname].yml`` where ``[hostname]`` is the hostname of each managed machine.

See the sample host variable file, `host_vars/myhost.my.org.yml <https://github.com/ESGF/esgf-ansible/blob/4.0.4/host_vars/myhost.my.org.yml>`_ for more information.
See the sample host variable file, `host_vars/myhost.my.org.yml <https://github.com/ESGF/esgf-ansible/blob/4.0.5/host_vars/myhost.my.org.yml>`_ for more information.

Also, see the other sample files in `host_vars <https://github.com/ESGF/esgf-ansible/blob/4.0.4/host_vars>`_, and find the sample file
Also, see the other sample files in `host_vars <https://github.com/ESGF/esgf-ansible/blob/4.0.5/host_vars>`_, and find the sample file
that best describes the desired use case.

Examples
Expand Down Expand Up @@ -76,13 +76,13 @@ A test deployment to all managed test hosts, with SSH via a non-root user, *joe*
Deployment Control
******************
These examples show various ways of controlling the deployment process.
Deployments are done in the order of includes in `install.yml <https://github.com/ESGF/esgf-ansible/blob/4.0.4/install.yml>`_.
Deployments are done in the order of includes in `install.yml <https://github.com/ESGF/esgf-ansible/blob/4.0.5/install.yml>`_.
This order is base, idp, index then data.
While repeating steps will not cause any problems, it simply slows things down.
Additionally, for a more reliable deployment process it may be desired to do one phase at a time.
Or if the deployment got interrupted after completing, for example, the `base` steps, these steps could be skipped when the deployment is started again.

Controlling the deployment is done with tags. The tags available in the `install.yml <https://github.com/ESGF/esgf-ansible/blob/4.0.4/install.yml>`_ play are ``base``, ``idp``, ``index``, ``data`` and ``publisher``.
Controlling the deployment is done with tags. The tags available in the `install.yml <https://github.com/ESGF/esgf-ansible/blob/4.0.5/install.yml>`_ play are ``base``, ``idp``, ``index``, ``data`` and ``publisher``.
These can be used with ``--tags`` and ``--skip-tags``, as well as with ``--limit [hostname]`` to control exactly what is done and where.
The ``base`` steps will be done everytime unless specified via ``--skip-tags``.

Expand Down
20 changes: 20 additions & 0 deletions docs/source/whatsnew/whatsnew.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,26 @@ The Critical section outlines any items the are highly likely to require changes
The Info section outlines informative items that may be helpful for users to know, but likely do not require action.
All items described within a release are relative to the previous release.

4.0.5 (2019-10-29)
******************

Critical
--------
- All Globus tools setup steps will be skipped if the user does not provide Globus account credentials

Info
----
- Added `developer documentation page <../developers/developers.html>`_
- Added `compatability infomation page <../faq/comptable.html>`_
- Tomcat updated to ``8.5.46``
- ESG-Search updated to ``v4.17.10``
- CoG update to ``v3.15.3``
- A number of updates within the ESGF-Publisher Conda environment
- Added playbook for node status tool ``install_ns.yml``
- Updated ACME Challenge (for LetsEncrypt certifcates) to v2
- Added ``roles/httpd/templates/robots.txt`` to direct web crawlers to not crawl ESGF data nodes


4.0.4 (2019-07-10)
******************

Expand Down
6 changes: 3 additions & 3 deletions group_vars/all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ httpd_version: "{{ '2.4' if (is_7) else '2.2' }}"
versions:
installer: 4.0.0-alpha1
java: jdk1.8.0_192
search: v4.17.9
search: v4.17.10
stats_api: v1.0.9
dashboard: v1.5.25
dashboard_db: 0.0.4
Expand Down Expand Up @@ -62,8 +62,8 @@ conda:
mods: lib/python2.7/site-packages

tomcat:
src: http://archive.apache.org/dist/tomcat/tomcat-8/v8.5.39/bin/apache-tomcat-8.5.39.tar.gz
root_dir: apache-tomcat-8.5.39
src: http://archive.apache.org/dist/tomcat/tomcat-8/v8.5.46/bin/apache-tomcat-8.5.46.tar.gz
root_dir: apache-tomcat-8.5.46
path: /usr/local/tomcat
webapps: /usr/local/tomcat/webapps
ts:
Expand Down
2 changes: 1 addition & 1 deletion group_vars/data.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ thredds:
content: "{{ esg.content }}/thredds"
tomcat_user:
name: "dnode_user"
pass: "{{ admin_pass |hash('md5') }}"
pass: "{{ admin_pass }}"
roles: "tdrAdmin,tdsConfig"

thredds_webapp:
Expand Down
6 changes: 5 additions & 1 deletion group_vars/index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ solr:

cog:
repo: https://github.com/EarthSystemCoG/COG.git
version: v3.14.3
version: v3.15.3
dest: /usr/local/cog/cog_install
base: /usr/local/cog
wsgi_dir: /etc/cog-wsgi-8889

node_status:
repo: https://github.com/ESGF/esgf-utils
dest: /usr/local/esgf-utils
19 changes: 19 additions & 0 deletions install_ns.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
- hosts: all
# strategy: free
become: yes
connection: paramiko
any_errors_fatal: true
tasks:
# Get the admin password
- name: Include the admin passwd role
block:
- include_role:
name: passwd
tags: always

- name: Node Status
block:
- include_role:
name: node_status
tags: index
when: "'index' in group_names"
1 change: 1 addition & 0 deletions roles/base/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,6 @@
loop_var: base_task

- name: Include Globus Tools
when: globus_user is defined and globus_pass is defined
include_role:
name: globus_tools
10 changes: 10 additions & 0 deletions roles/data/tasks/thredds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,16 @@
src: thredds/log4j2.xml
dest: "{{ tomcat.webapps }}/{{ thredds_webapp.name }}/WEB-INF/classes/log4j2.xml"

- name: Digest thredds user credential
no_log: true
command: "{{ tomcat.path }}/bin/digest.sh -a 'sha-256' -s 20 -i 5 {{ thredds.tomcat_user.pass }}"
register: cred_digest

- name: Set credential digest variable
no_log: true
set_fact:
thredds_pass_digest: "{{ cred_digest.stdout.split(':')[-1] }}"

- name: Install {{ thredds.tomcat_user.name }} into tomcat-users.xml
template:
src: thredds/tomcat-users.xml.j2
Expand Down
2 changes: 1 addition & 1 deletion roles/data/templates/thredds/tomcat-users.xml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
<role rolename="tdsConfig"/>
<role rolename="manager"/>
<role rolename="tdrAdmin"/>
<user username="{{ thredds.tomcat_user.name }}" password="{{ thredds.tomcat_user.pass }}" roles="{{ thredds.tomcat_user.roles }}"/>
<user username="{{ thredds.tomcat_user.name }}" password="{{ thredds_pass_digest }}" roles="{{ thredds.tomcat_user.roles }}"/>
</tomcat-users>
2 changes: 1 addition & 1 deletion roles/globus_certs/meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ dependencies:
}
- {
role: 'myproxy_certs',
when: "'idp' is in group_names"
when: "'idp' in group_names"
}
10 changes: 7 additions & 3 deletions roles/httpd/tasks/letsencrypt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
# Create an ACME Challenge
- name: Create ACME Challenge
acme_certificate:
acme_directory: https://acme-v01.api.letsencrypt.org/directory
acme_version: 2
terms_agreed: yes
acme_directory: https://acme-v02.api.letsencrypt.org/directory
account_key_src: /tmp/account_key.pem
csr: /tmp/httpdhost.csr
dest: "{{ httpd.hostcert }}"
Expand Down Expand Up @@ -34,7 +36,9 @@
- name: Run ACME Challenge
when: acme_challenge is changed
acme_certificate:
acme_directory: https://acme-v01.api.letsencrypt.org/directory
acme_directory: https://acme-v02.api.letsencrypt.org/directory
acme_version: 2
terms_agreed: yes
account_key_src: /tmp/account_key.pem
csr: /tmp/httpdhost.csr
dest: "{{ httpd.hostcert }}"
Expand All @@ -45,4 +49,4 @@
when: acme_challenge is changed
service:
name: httpd
state: stopped
state: stopped
14 changes: 13 additions & 1 deletion roles/httpd/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,19 @@
package:
name:
- "{{ pkgs.apache }}"
- "mod_ssl"
- mod_ssl
- mod_security
- mod_security_crs

- name: Install mod_security.conf
template:
src: mod_security.conf
dest: /etc/httpd/conf.d/mod_security.conf

- name: Install robots.txt
template:
src: robots.txt
dest: /var/www/html/robots.txt

# Create config dirs
- name: Create esgf-proxy configuration directories
Expand Down
5 changes: 5 additions & 0 deletions roles/httpd/templates/httpd2.2/esgf-httpd.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ LoadModule ssl_module modules/mod_ssl.so
User apache
Group apache
ServerAdmin root@localhost

# Include modsecurity rules
# Modify the below file to change rules from default
#Include conf.d/mod_security.conf

UseCanonicalName Off
HostnameLookups Off
ErrorLog logs/error_log
Expand Down
Loading