Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
22 changes: 12 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out the codebase
uses: actions/checkout@v3
uses: actions/checkout@v5

- name: Set up Python 3
uses: actions/setup-python@v4
uses: actions/setup-python@v6
with:
python-version: '3.x'
python-version: '3 - 3.13'

- name: Install test dependencies
run: |
Expand All @@ -44,25 +44,27 @@ jobs:
fail-fast: false
matrix:
include:
- distro: ubuntu1604
ansible-version: '>=2.10, <2.11'
- distro: ubuntu1604
- distro: ubuntu1804
ansible-version: '>=9, <10'
- distro: ubuntu2004
ansible-version: '>=12, <13'
- distro: ubuntu2204
- distro: ubuntu2404

steps:
- name: Check out the codebase
uses: actions/checkout@v3
uses: actions/checkout@v5
with:
path: "${{ github.repository }}"

- name: Set up Python 3
uses: actions/setup-python@v4
uses: actions/setup-python@v6
with:
python-version: '3.x'
python-version: '3 - 3.13'

- name: Install test dependencies
run: pip install 'ansible${{ matrix.ansible-version }}' molecule-plugins[docker] docker
run: |
pip install 'ansible${{ matrix.ansible-version }}' molecule-plugins[docker] docker

- name: Run Molecule tests
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out the codebase
uses: actions/checkout@v3
uses: actions/checkout@v5

- name: Publish to Galaxy
uses: robertdebock/galaxy-action@1.2.0
Expand Down
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![Build Status](https://travis-ci.org/Oefenweb/ansible-wordpress.svg?branch=master)](https://travis-ci.org/Oefenweb/ansible-wordpress) [![Ansible Galaxy](http://img.shields.io/badge/ansible--galaxy-wordpress-blue.svg)](https://galaxy.ansible.com/Oefenweb/wordpress)

Set up (multiple) wordpress installations in Debian-like systems (using `wp-cli`).
Set up (multiple) WordPress installations in Debian-like systems (using `wp-cli`).

#### Requirements

Expand All @@ -23,18 +23,18 @@ This role assumes a working virtual host (that handles `wordpress_url`).
* `wordpress_installs.{n}.dbpass`: [required]: Database password (**make sure to change**)
* `wordpress_installs.{n}.dbhost`: [default: `localhost`, optional]: Database host
* `wordpress_installs.{n}.dbprefix`: [default: `wp_`, optional]: Prefix for database tables
* `wordpress_installs.{n}.path`: [required]: Install directory for wordpress
* `wordpress_installs.{n}.locale`: [default: `en_US`, optional]: Language of the downloaded Wordpress
* `wordpress_installs.{n}.path`: [required]: Install directory for WordPress
* `wordpress_installs.{n}.locale`: [default: `en_US`, optional]: Language of the downloaded WordPress
* `wordpress_installs.{n}.owner`: [default: `www-data`]: The name of the user that should own the install
* `wordpress_installs.{n}.group`: [default: `owner`, `www-data`]: The name of the group that should own the install
* `wordpress_installs.{n}.url`: [required]: Wordpress url
* `wordpress_installs.{n}.title`: [required]: Wordpress title
* `wordpress_installs.{n}.admin_name`: [default: `admin`, optional]: Wordpress admin (user)name
* `wordpress_installs.{n}.admin_email`: [required]: Wordpress admin email address
* `wordpress_installs.{n}.admin_password`: [required]: Wordpress admin password (**make sure to change**)
* `wordpress_installs.{n}.url`: [required]: WordPress url
* `wordpress_installs.{n}.title`: [required]: WordPress title
* `wordpress_installs.{n}.admin_name`: [default: `admin`, optional]: WordPress admin (user)name
* `wordpress_installs.{n}.admin_email`: [required]: WordPress admin email address
* `wordpress_installs.{n}.admin_password`: [required]: WordPress admin password (**make sure to change**)

* `wordpress_installs.{n}.cron`: [optional]: Cron declaration
* `wordpress_installs.{n}.cron.use_crond`: [default: `false`]: Whether or not to use `crond` instead of wp-cron
* `wordpress_installs.{n}.cron.use_crond`: [default: `false`]: Whether to use `crond` instead of wp-cron
* `wordpress_installs.{n}.cron.user`: [default: `www-data`]: User to run job as
* `wordpress_installs.{n}.cron.schedule`: [optional]: Cron schedule declaration
* `wordpress_installs.{n}.cron.schedule.day`: [default: `*`]: Day when the job should run
Expand All @@ -45,18 +45,18 @@ This role assumes a working virtual host (that handles `wordpress_url`).

* `wordpress_installs.{n}.themes`: [required]: (Additional) themes to install (and activate)
* `wordpress_installs.{n}.themes.{n}.name`: [required]: Name of the theme
* `wordpress_installs.{n}.themes.{n}.activate`: [default: `false`, optional]: Whether or not to activate the theme
* `wordpress_installs.{n}.themes.{n}.activate`: [default: `false`, optional]: Whether to activate the theme

* `wordpress_installs.{n}.plugins`: [required]: (Additional) plugins to install (and activate)
* `wordpress_installs.{n}.plugins.{n}.name`: [required]: Name of the plugin
* `wordpress_installs.{n}.plugins.{n}.zip`: [optional]: Zip of the plugin
* `wordpress_installs.{n}.plugins.{n}.url`: [optional]: Url of the plugin
* `wordpress_installs.{n}.plugins.{n}.activate`: [default: `true`, optional]: Whether to activate or to deactivate the plugin
* `wordpress_installs.{n}.plugins.{n}.force`: [default: `false`, optional]: Whether or not to add the `--force` option during install
* `wordpress_installs.{n}.plugins.{n}.force`: [default: `false`, optional]: Whether to add the `--force` option during install

* `wordpress_installs.{n}.users`: [optional]: User declarations
* `wordpress_installs.{n}.users.src`: [required]: The local path of the [csv file](http://wp-cli.org/commands/user/import-csv/) to import, can be absolute or relative (e.g. `../../../files/wordpress/users.csv`)
* `wordpress_installs.{n}.users.skip_update`: [default: `true`, optional]: Whether or not to update users that already exist
* `wordpress_installs.{n}.users.skip_update`: [default: `true`, optional]: Whether to update users that already exist

* `wordpress_installs.{n}.options`: [required]: Options to add, update or delete
* `wordpress_installs.{n}.options.{n}.command`: [required]: Add, update or delete
Expand Down
25 changes: 16 additions & 9 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,33 @@
role = File.basename(File.expand_path(File.dirname(__FILE__)))

boxes = [
{
:name => "ubuntu-1604",
:box => "bento/ubuntu-16.04",
:ip => '10.0.0.13',
:cpu => "50",
:ram => "256"
},
{
:name => "ubuntu-1804",
:box => "bento/ubuntu-18.04",
:ip => '10.0.0.14',
:ip => '10.0.0.13',
:cpu => "50",
:ram => "384"
},
{
:name => "ubuntu-2004",
:box => "bento/ubuntu-20.04",
:ip => '10.0.0.14',
:cpu => "50",
:ram => "512"
},
{
:name => "ubuntu-2204",
:box => "bento/ubuntu-22.04",
:ip => '10.0.0.15',
:cpu => "50",
:ram => "384"
:ram => "512"
},
{
:name => "ubuntu-2404",
:box => "bento/ubuntu-24.04",
:ip => '10.0.0.16',
:cpu => "50",
:ram => "512"
},
]

Expand Down
12 changes: 5 additions & 7 deletions meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,14 @@ galaxy_info:
platforms:
- name: Ubuntu
versions:
- precise
- trusty
- xenial
- bionic
- focal
- jammy
- noble
- name: Debian
versions:
- wheezy
- jessie
- stretch
- buster
- bullseye
- bookworm
galaxy_tags:
- web
dependencies: []
6 changes: 1 addition & 5 deletions molecule/default/collections.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,2 @@
---
collections:
- name: community.docker
version: '>=1.2.0,<2'
- name: community.general
version: '>=2,<3'
collections: []
2 changes: 1 addition & 1 deletion molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ driver:
name: docker
platforms:
- name: instance
image: "geerlingguy/docker-${MOLECULE_DISTRO:-ubuntu1604}-ansible:latest"
image: "geerlingguy/docker-${MOLECULE_DISTRO:-ubuntu2004}-ansible:latest"
command: ${MOLECULE_DOCKER_COMMAND:-""}
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:rw
Expand Down
2 changes: 1 addition & 1 deletion tasks/configure.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# tasks file
---
- name: configure | create (data) directories

Check warning on line 3 in tasks/configure.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.
ansible.builtin.file:
path: "{{ item }}"
state: directory
owner: root
group: root
mode: 0755
mode: '0755'
with_items:
- "{{ wordpress_data_path }}/themes"
- "{{ wordpress_data_path }}/plugins"
Expand Down
22 changes: 11 additions & 11 deletions tasks/plugins.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
with_subelements:
- "{{ wordpress_installs }}"
- plugins
when: item.1
when: item.1.name | length > 0
tags:
- wordpress-plugins-is-installed-plugin

Expand All @@ -20,7 +20,7 @@
changed_when: true
with_items: "{{ _check_installation_plugins.results | default([]) }}"
when:
- item.item.1.name
- item.item.1.name | length > 0
- not item.item.1.zip | default(false)
- not item.item.1.url | default(false)
- item.rc != 0
Expand All @@ -34,10 +34,10 @@
dest: "{{ wordpress_data_path }}/plugins/{{ item.item.1.name }}.zip"
owner: root
group: root
mode: 0644
mode: '0644'
with_items: "{{ _check_installation_plugins.results | default([]) }}"
when:
- item.item.1.name
- item.item.1.name | length > 0
- item.item.1.zip | default(false)
- not item.item.1.url | default(false)
- item.rc != 0
Expand All @@ -53,7 +53,7 @@
changed_when: true
with_items: "{{ _check_installation_plugins.results | default([]) }}"
when:
- item.item.1.name
- item.item.1.name | length > 0
- item.item.1.zip | default(false)
- not item.item.1.url | default(false)
- item.rc != 0
Expand All @@ -69,7 +69,7 @@
changed_when: true
with_items: "{{ _check_installation_plugins.results | default([]) }}"
when:
- item.item.1.name
- item.item.1.name | length > 0
- not item.item.1.zip | default(false)
- item.item.1.url | default(false)
- item.rc != 0
Expand All @@ -84,7 +84,7 @@
with_subelements:
- "{{ wordpress_installs }}"
- plugins
when: item.1.name
when: item.1.name | length > 0
tags:
- wordpress-plugins-check-install-plugin

Expand All @@ -97,8 +97,8 @@
- "{{ wordpress_installs }}"
- plugins
when:
- item.1.name
- item.1.activate | default(true)
- item.1.name | length > 0
- item.1.activate | bool | default(true)
tags:
- wordpress-plugins-activate-plugin

Expand All @@ -111,7 +111,7 @@
- "{{ wordpress_installs }}"
- plugins
when:
- item.1.name
- not item.1.activate | default(true)
- item.1.name | length > 0
- not item.1.activate | bool | default(true)
tags:
- wordpress-plugins-deactivate-plugin
10 changes: 5 additions & 5 deletions tasks/themes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
with_subelements:
- "{{ wordpress_installs }}"
- themes
when: item.1.name
when: item.1.name | length > 0
tags:
- wordpress-themes-is-installed-theme

Expand All @@ -19,7 +19,7 @@
changed_when: true
with_items: "{{ _check_installation_themes.results | default([]) }}"
when:
- item.item.1.name
- item.item.1.name | length > 0
- item.rc != 0
tags:
- wordpress-themes-install-theme
Expand All @@ -31,7 +31,7 @@
with_subelements:
- "{{ wordpress_installs }}"
- themes
when: item.1.name
when: item.1.name | length > 0
tags:
- wordpress-themes-install-theme-check

Expand All @@ -44,7 +44,7 @@
- "{{ wordpress_installs }}"
- themes
when:
- item.1.name
- item.1.activate | default(false)
- item.1.name | length > 0
- item.1.activate | bool | default(false)
tags:
- wordpress-themes-activate-theme
2 changes: 1 addition & 1 deletion tasks/users.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
dest: "{{ wordpress_data_path }}/users/{{ item.dbname }}.csv"
owner: root
group: root
mode: 0644
mode: '0644'
register: _check_copy_users
with_items: "{{ wordpress_installs }}"
when: item.users.src is defined
Expand Down
2 changes: 1 addition & 1 deletion tasks/wp-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
force: true
owner: root
group: root
mode: 0755
mode: '0755'
tags:
- wordpress-wp-cli-install

Expand Down
Loading
Loading