Skip to content
Open
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
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ jobs:
- "centos-stream-9"
- "debian-12"
- "fedora-latest"
- "oraclelinux-8"
- "oraclelinux-9"
- "rockylinux-8"
- "rockylinux-9"
- "ubuntu-2204"
Expand Down
4 changes: 3 additions & 1 deletion Berksfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# frozen_string_literal: true

source 'https://supermarket.chef.io'

metadata

group :integration do
cookbook 'confluence_test', path: 'test/fixtures/cookbooks/confluence_test'
cookbook 'test', path: 'test/cookbooks/test'
end
64 changes: 64 additions & 0 deletions LIMITATIONS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Limitations

## Distribution Method

Atlassian Confluence is distributed as a vendor binary — not through OS package managers (apt, yum, dnf, zypper). This cookbook downloads the standalone tarball directly from Atlassian's download site.

- **Standalone tarball** (`atlassian-confluence-<version>.tar.gz`): Platform-independent Java application archive
- **Binary installer** (`atlassian-confluence-<version>-x64.bin`): 64-bit Linux only

This cookbook uses the **standalone tarball** method.

## Package Availability

### APT (Debian/Ubuntu)

No official Atlassian apt repository exists. Confluence is not available via apt.

### DNF/YUM (RHEL family)

No official Atlassian yum/dnf repository exists. Confluence is not available via yum or dnf.

### Zypper (SUSE)

No official Atlassian zypper repository exists. Confluence is not available via zypper.

## Architecture Limitations

- The standalone tarball is a Java application and is architecture-independent
- The binary installer is available for **x86_64 (64-bit) only**
- arm64 (aarch64) is supported via the standalone tarball since it is pure Java

## Operating System Support

Atlassian officially supports "Linux (most distributions)" without specifying particular distributions. The cookbook supports:

- AlmaLinux 8, 9
- Amazon Linux 2023
- CentOS Stream 9
- Debian 12
- Fedora (latest)
- Oracle Linux 8, 9
- Red Hat Enterprise Linux 8, 9
- Rocky Linux 8, 9
- Ubuntu 22.04, 24.04

### Unsupported

- Alpine Linux 3.5 and earlier (known Atlassian incompatibility)
- Windows Nano
- macOS / OSX (evaluation only per Atlassian)

## Java Requirements

- Confluence requires **Java 21** (Oracle JDK or Eclipse Temurin)
- The standalone tarball does **not** bundle a JRE — Java must be installed separately
- The binary installer bundles Temurin Java 21

This cookbook does **not** manage Java installation. Use a separate cookbook such as [java](https://github.com/sous-chefs/java).

## Known Issues

- Confluence will not work with MariaDB (use MySQL 8.4 instead)
- Confluence will not work with Percona Server
- This cookbook does not manage database or reverse proxy configuration
9 changes: 9 additions & 0 deletions documentation/confluence_config.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Configures Confluence JVM settings, Tomcat connector, and home directory.
| Action | Description |
|-----------|----------------------------------------------------------|
| `:create` | Creates/updates Confluence configuration files (default) |
| `:delete` | Removes all managed configuration files |

## Properties

Expand Down Expand Up @@ -87,6 +88,14 @@ confluence_config 'confluence' do
end
```

### Delete Configuration

```ruby
confluence_config 'confluence' do
action :delete
end
```

## Files Managed

This resource manages the following files:
Expand Down
8 changes: 4 additions & 4 deletions documentation/confluence_install.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ Downloads and installs Atlassian Confluence standalone tarball.

## Actions

| Action | Description |
|------------|-----------------------------------------------|
| `:install` | Downloads and installs Confluence (default) |
| `:remove` | Removes the Confluence installation directory |
| Action | Description |
|------------|----------------------------------------------------------|
| `:install` | Downloads and installs Confluence (default) |
| `:remove` | Removes the Confluence installation and home directories |

## Properties

Expand Down
9 changes: 9 additions & 0 deletions documentation/confluence_service.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Creates and manages the Confluence systemd service.
| `:restart` | Restarts the Confluence service |
| `:enable` | Enables the service to start on boot |
| `:disable` | Disables the service from starting on boot |
| `:delete` | Stops, disables, and removes the systemd unit |

## Properties

Expand Down Expand Up @@ -73,6 +74,14 @@ confluence_service 'confluence' do
end
```

### Delete Service

```ruby
confluence_service 'confluence' do
action :delete
end
```

## Files Managed

This resource manages the following files:
Expand Down
3 changes: 0 additions & 3 deletions kitchen.global.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,11 @@ platforms:
- name: almalinux-9
- name: amazonlinux-2023
- name: centos-stream-9
- name: debian-11
- name: debian-12
- name: fedora-latest
- name: opensuse-leap-15
- name: oraclelinux-8
- name: oraclelinux-9
- name: rockylinux-8
- name: rockylinux-9
- name: ubuntu-20.04
- name: ubuntu-22.04
- name: ubuntu-24.04
12 changes: 9 additions & 3 deletions kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,22 @@ platforms:
- name: ubuntu-24.04

provisioner:
name: chef_zero
name: chef_infra
product_name: chef
product_version: <%= ENV['CHEF_VERSION'] || 'latest' %>
install_strategy: once

suites:
- name: default
run_list:
- recipe[confluence_test::default]
- recipe[test::default]
verifier:
inspec_tests:
- path: test/integration/default

- name: standalone
run_list:
- recipe[confluence_test::standalone]
- recipe[test::standalone]
verifier:
inspec_tests:
- path: test/integration/standalone
2 changes: 2 additions & 0 deletions libraries/helpers.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

#
# Cookbook:: confluence
# Library:: helpers
Expand Down
2 changes: 2 additions & 0 deletions metadata.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

name 'confluence'
maintainer 'Sous Chefs'
maintainer_email 'help@sous-chefs.org'
Expand Down
2 changes: 2 additions & 0 deletions resources/_partial/_common_properties.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

#
# Cookbook:: confluence
# Resource:: Partial:: _common_properties
Expand Down
16 changes: 16 additions & 0 deletions resources/config.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

#
# Cookbook:: confluence
# Resource:: config
Expand Down Expand Up @@ -123,6 +125,20 @@
end
end

action :delete do
file ::File.join(new_resource.install_path, 'confluence/WEB-INF/classes/confluence-init.properties') do
action :delete
end

file ::File.join(new_resource.install_path, 'bin/setenv.sh') do
action :delete
end

file ::File.join(new_resource.install_path, 'conf/server.xml') do
action :delete
end
end

action_class do
include Confluence::Cookbook::Helpers
end
7 changes: 7 additions & 0 deletions resources/install.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

#
# Cookbook:: confluence
# Resource:: install
Expand Down Expand Up @@ -122,6 +124,11 @@
recursive true
action :delete
end

directory new_resource.home_path do
recursive true
action :delete
end
end

action_class do
Expand Down
8 changes: 8 additions & 0 deletions resources/service.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

#
# Cookbook:: confluence
# Resource:: service
Expand Down Expand Up @@ -81,6 +83,12 @@
end
end

action :delete do
systemd_unit "#{new_resource.service_name}.service" do
action [:stop, :disable, :delete]
end
end

action_class do
include Confluence::Cookbook::Helpers
end
4 changes: 4 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
# frozen_string_literal: true

require 'chefspec'
require 'chefspec/berkshelf'

RSpec.configure do |config|
config.color = true
config.formatter = :documentation
config.file_cache_path = '/var/cache/chef'
config.log_level = :error
config.platform = 'ubuntu'
Expand Down
2 changes: 2 additions & 0 deletions spec/unit/libraries/helpers_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'
require_relative '../../../libraries/helpers'

Expand Down
22 changes: 22 additions & 0 deletions spec/unit/resources/confluence_config_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

describe 'confluence_config' do
Expand Down Expand Up @@ -118,4 +120,24 @@
)
end
end

context 'with :delete action' do
recipe do
confluence_config 'confluence' do
action :delete
end
end

it 'deletes confluence-init.properties' do
expect(chef_run).to delete_file('/opt/atlassian/confluence/confluence/WEB-INF/classes/confluence-init.properties')
end

it 'deletes setenv.sh' do
expect(chef_run).to delete_file('/opt/atlassian/confluence/bin/setenv.sh')
end

it 'deletes server.xml' do
expect(chef_run).to delete_file('/opt/atlassian/confluence/conf/server.xml')
end
end
end
23 changes: 23 additions & 0 deletions spec/unit/resources/confluence_install_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

describe 'confluence_install' do
Expand Down Expand Up @@ -132,4 +134,25 @@
)
end
end

context 'with :remove action' do
recipe do
confluence_install 'confluence' do
version '10.2.2'
action :remove
end
end

it 'deletes the install directory' do
expect(chef_run).to delete_directory('/opt/atlassian/confluence').with(
recursive: true
)
end

it 'deletes the home directory' do
expect(chef_run).to delete_directory('/var/atlassian/application-data/confluence').with(
recursive: true
)
end
end
end
22 changes: 22 additions & 0 deletions spec/unit/resources/confluence_service_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'spec_helper'

describe 'confluence_service' do
Expand Down Expand Up @@ -105,4 +107,24 @@
expect(chef_run).to enable_systemd_unit('confluence.service')
end
end

context 'with :delete action' do
recipe do
confluence_service 'confluence' do
action :delete
end
end

it 'stops the systemd service' do
expect(chef_run).to stop_systemd_unit('confluence.service')
end

it 'disables the systemd service' do
expect(chef_run).to disable_systemd_unit('confluence.service')
end

it 'deletes the systemd service unit' do
expect(chef_run).to delete_systemd_unit('confluence.service')
end
end
end
Loading
Loading