diff --git a/.fixtures.yml b/.fixtures.yml index 5d512f7e..91fc33e7 100644 --- a/.fixtures.yml +++ b/.fixtures.yml @@ -14,7 +14,6 @@ fixtures: python: "puppet/python" inifile: "puppetlabs/inifile" mongodb: "puppet/mongodb" - postgresql: "puppetlabs/postgresql" rabbitmq: "puppet/rabbitmq" facter: "ghoneycutt/facter" selinux: "puppet/selinux" diff --git a/CHANGELOG.md b/CHANGELOG.md index e125c8d2..04025763 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,9 @@ - Drop support for CentOS 6 #304 (Enhancement) Contributed by @nmaludy + +- Drop support for Mistral and PostgreSQL #312 (Enhancement) + Contributed by @nmaludy - Corrected `logging` setting for `api`, `auth` and `stream` to point at the `/etc/st2/logging..gunicorn.conf` logging config files, the current default. (Bugfix) diff --git a/Makefile b/Makefile index 201bb270..be6ee538 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,7 @@ CI_REPO_BRANCH ?= master all: .DEFAULT .PHONY: clean -clean: clean-ci-repo clean-pyc clean-kitchen clean-puppet-librarian clean-bundler clean-pkg +clean: clean-ci-repo clean-pyc clean-kitchen clean-puppet-librarian clean-bundler clean-pkg clean-rspec # Clone the ci-repo into the ci/ directory .PHONY: clone-ci-repo @@ -79,6 +79,14 @@ clean-pkg: @echo rm -rf ${ROOT_DIR}/pkg +# Clean bundler build files +.PHONY: clean-rspec +clean-rspec: + @echo + @echo "== clean-rspec ======================================" + @echo + rm -rf ${ROOT_DIR}/spec/fixtures/modules + # list all makefile targets .PHONY: list list: diff --git a/README.md b/README.md index 6d23b462..113234ec 100644 --- a/README.md +++ b/README.md @@ -391,11 +391,18 @@ $res = run_task('st2::key_get', $stackstorm_target, * Puppet 5 * Puppet 6 +#### :warning: End-of-Support Notice - Mistral + +Support for Mistral has been dropped as of StackStorm `3.3.0`. + +As of version `1.8` this module no longer supports Mistral (and subsequently PostgreSQL) +Neither Mistral nor Postgresql will be installed or managed by this module. + #### :warning: End-of-Support Notice - CentOS 6 Support for CentOS 6 has been dropped as of StackStorm `3.3.0`. -As of version `1.8` this module no longer supports CentOS 6 to coordinate with these changes. +As of version `1.8` this module no longer supports CentOS 6, so changes will not be tested against this platform. #### :warning: Deprecation Notice - Puppet 4 diff --git a/REFERENCE.md b/REFERENCE.md index 83ba1085..dc983b27 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -22,11 +22,9 @@ * [`st2::profile::client`](#st2profileclient): Profile to install, configure and manage all client libraries for st2 * [`st2::profile::facter`](#st2profilefacter): Setup custom fact locations * [`st2::profile::fullinstall`](#st2profilefullinstall): This class performs a full default install of StackStorm and all its components on a single node. -* [`st2::profile::mistral`](#st2profilemistral): This class installs OpenStack Mistral, a workflow engine that integrates with StackStorm. * [`st2::profile::mongodb`](#st2profilemongodb): StackStorm compatable installation of MongoDB and dependencies. * [`st2::profile::nginx`](#st2profilenginx): StackStorm compatible installation of nginx and dependencies. * [`st2::profile::nodejs`](#st2profilenodejs): st2 compatable installation of NodeJS and dependencies for use with StackStorm. -* [`st2::profile::postgresql`](#st2profilepostgresql): st2 compatable installation of PostgreSQL and dependencies for use with StackStorm and Mistral. * [`st2::profile::python`](#st2profilepython): StackStorm compatable installation of Python and dependencies. * [`st2::profile::rabbitmq`](#st2profilerabbitmq): StackStorm compatable installation of RabbitMQ and dependencies. * [`st2::profile::selinux`](#st2profileselinux): Configure SELinux so that StackStorm services run properly @@ -111,7 +109,7 @@ class { 'st2': } ``` -##### Different passwords for each database (MongoDB, RabbitMQ, Postgres) +##### Different passwords for each database (MongoDB, RabbitMQ) ```puppet class { 'st2': @@ -124,9 +122,6 @@ class { 'st2': # RabbitMQ user for StackStorm rabbitmq_username => 'st2', rabbitmq_password => '@!fsdf0#45', - # Postrgres user for Mistral - mistral_db_username => 'stackstorm', - mistral_db_password => 'FSDfcds#45w', } ``` @@ -367,56 +362,6 @@ Url to the StackStorm Exchange index file. (default undef) Default value: `undef` -##### `mistral_db_host` - -Data type: `Any` - -Hostname/IP of the Mistral Postgres database - -Default value: $::st2::params::hostname - -##### `mistral_db_name` - -Data type: `Any` - -Database name of the Mistral Postgres database - -Default value: $::st2::params::mistral_db_name - -##### `mistral_db_username` - -Data type: `Any` - -Username for authentication to the Mistral Postgres database - -Default value: $::st2::params::mistral_db_username - -##### `mistral_db_password` - -Data type: `Any` - -Password for authentication to the Mistral Postgres database - -Default value: $::st2::params::admin_password - -##### `mistral_db_bind_ips` - -Data type: `Any` - -String of IPs (csv) that the Mistral Postgres database -will accept connections on (default: 127.0.0.1) - -Default value: $::st2::params::mistral_db_bind_ips - -##### `mistral_manage` - -Data type: `Any` - -If this module should manage the Mistral install and services (st2mistral and postgres). -(default: true if Ubuntu <= 16.04 or CentOS <= 7, false otherwise) - -Default value: $st2::params::mistral_manage - ##### `syslog` Data type: `Any` @@ -1847,8 +1792,6 @@ Components: * MongoDB * NodeJS * nginx - * PostgreSQL (required by Mistral) - * Mistral #### Examples @@ -1869,131 +1812,6 @@ class { 'st2': include st2::profile::fullinstall ``` -### st2::profile::mistral - -This class installs OpenStack Mistral, a workflow engine that integrates with StackStorm. - -#### Examples - -##### Basic Usage - -```puppet -include st2::profile::mistral -``` - -##### External database - -```puppet -class { 'st2::profile::mistral': - db_host => 'postgres.domain.tld', - db_username => 'mistral', - db_password => 'xyz123', -} -``` - -##### External RabbitMQ - -```puppet -class { 'st2::profile::mistral': - rabbitmq_hostname => 'rabbitmq.domain.tld', - rabbitmq_username => 'mistral', - rabbitmq_password => 'xyz123', -} -``` - -#### Parameters - -The following parameters are available in the `st2::profile::mistral` class. - -##### `version` - -Data type: `Any` - -Version of the st2mistral package to install - -Default value: $::st2::version - -##### `db_host` - -Data type: `Any` - -Server hosting Mistral Postgres DB - -Default value: $::st2::mistral_db_host - -##### `db_name` - -Data type: `Any` - -Name of the Mistral Postgres database - -Default value: $::st2::mistral_db_name - -##### `db_username` - -Data type: `Any` - -Mistral user for authenticating with PostgreSQL - -Default value: $::st2::mistral_db_username - -##### `db_password` - -Data type: `Any` - -Mistral password for authenticating with PostgreSQL - -Default value: $::st2::mistral_db_password - -##### `manage` - -Data type: `Any` - -If this module should manage the st2mistral install and service -(default: true if Ubuntu <= 16.04 or CentOS <= 7, false otherwise) - -Default value: $::st2::mistral_manage - -##### `rabbitmq_username` - -Data type: `Any` - -Username for authenticating with RabbitMQ - -Default value: $::st2::rabbitmq_username - -##### `rabbitmq_password` - -Data type: `Any` - -Password for authenticating with RabbitMQ - -Default value: $::st2::rabbitmq_password - -##### `rabbitmq_hostname` - -Data type: `Any` - -Hostname/IP of the RabbitMQ server - -Default value: $::st2::rabbitmq_hostname - -##### `rabbitmq_port` - -Data type: `Any` - -Port for connecting to RabbitMQ - -Default value: $::st2::rabbitmq_port - -##### `rabbitmq_vhost` - -Data type: `Any` - -RabbitMQ virtual host for Mistral - -Default value: $::st2::rabbitmq_vhost - ### st2::profile::mongodb StackStorm compatable installation of MongoDB and dependencies. @@ -2152,47 +1970,6 @@ Version of NodeJS to install. If not provided it will be auto-calcuated based on Default value: $::st2::nodejs_version -### st2::profile::postgresql - -st2 compatable installation of PostgreSQL and dependencies for use with StackStorm and Mistral. - -#### Examples - -##### Basic usage - -```puppet -include st2::profile::postgresql -``` - -##### Customizing parameters - -```puppet -class { 'st2::profile::postgresql': - db_bind_ips => '0.0.0.0', -} -``` - -#### Parameters - -The following parameters are available in the `st2::profile::postgresql` class. - -##### `bind_ips` - -Data type: `Any` - -String of IPs (csv) that the Postgres database will accept connections on. - -Default value: $::st2::mistral_db_bind_ips - -##### `manage` - -Data type: `Any` - -If this module should manage the postgres install and service -(default: true if Ubuntu <= 16.04 or CentOS <= 7, false otherwise) - -Default value: $::st2::mistral_manage - ### st2::profile::python StackStorm compatable installation of Python and dependencies. diff --git a/build/centos7-puppet5/Puppetfile b/build/centos7-puppet5/Puppetfile index 27e33ef2..1da14f1c 100644 --- a/build/centos7-puppet5/Puppetfile +++ b/build/centos7-puppet5/Puppetfile @@ -21,44 +21,44 @@ # ###################### # # Latest Module Tree # # ###################### -# └─┬ stackstorm-st2 (v1.4.0) -# ├── jamtur01-httpauth (v0.0.3) -# ├── puppetlabs-stdlib (v5.2.0) -# ├─┬ puppetlabs-apt (v6.3.0) -# │ └── puppetlabs-translate (v1.2.0) -# ├── saz-sudo (v6.0.0) -# ├─┬ puppet-python (v2.2.2) -# │ └── puppet-epel (v1.3.1) -# ├── puppetlabs-inifile (v2.5.0) -# ├── puppet-mongodb (v2.4.1) -# ├─┬ puppetlabs-postgresql (v5.12.1) -# │ └── puppetlabs-concat (v5.3.0) -# ├─┬ puppet-rabbitmq (v9.0.0) -# │ ├── puppet-archive (v3.2.1) -# │ └── camptocamp-systemd (v2.3.0) +# └─┬ stackstorm-st2 (v1.7.0) # ├── ghoneycutt-facter (v3.5.0) -# ├── puppet-selinux (v1.6.1) -# ├── puppet-nginx (v0.16.0) -# └── puppet-nodejs (v7.0.0) +# ├── jamtur01-httpauth (v0.0.6) +# ├── npwalker-recursive_file_permissions (v0.6.0) +# ├── puppet-epel (v3.0.1) +# ├── puppet-mongodb (v3.1.0) +# ├─┬ puppet-nginx (v1.1.0) +# │ └── puppetlabs-concat (v6.2.0) +# ├── puppet-nodejs (v7.0.1) +# ├── puppet-python (v4.1.1) +# ├─┬ puppet-rabbitmq (v10.1.1) +# │ ├── camptocamp-systemd (v2.9.0) +# │ └── puppet-archive (v4.5.0) +# ├── puppet-selinux (v3.2.0) +# ├─┬ puppetlabs-apt (v7.5.0) +# │ └── puppetlabs-translate (v2.2.0) +# ├── puppetlabs-inifile (v4.2.0) +# ├── puppetlabs-stdlib (v5.2.0) +# ├── puppetlabs-yumrepo_core (v1.0.7) +# └── saz-sudo (v6.0.0) forge "https://forgeapi.puppetlabs.com" +mod 'ghoneycutt-facter' mod 'jamtur01-httpauth' -mod 'puppetlabs-stdlib' -mod 'puppetlabs-apt' -mod 'puppetlabs-yumrepo_core' +mod 'npwalker-recursive_file_permissions' mod 'puppet-epel' -mod 'puppetlabs-translate' # dependency of puppetlabs-apt -mod 'saz-sudo' -mod 'puppet-python' -mod 'puppetlabs-inifile' mod 'puppet-mongodb' -mod 'puppetlabs-postgresql' -mod 'puppetlabs-concat' # dependency of puppetlabs-postgresql +mod 'puppet-nginx' +mod 'puppetlabs-concat' # dependency of puppet-nginx' +mod 'puppet-nodejs' +mod 'puppet-python' mod 'puppet-rabbitmq' -mod 'puppet-archive' # dependency of puppet-rabbitmq mod 'camptocamp-systemd' # dependency of puppet-rabbitmq -mod 'ghoneycutt-facter' +mod 'puppet-archive' # dependency of puppet-rabbitmq mod 'puppet-selinux' -mod 'puppet-nginx' -mod 'puppet-nodejs' -mod 'npwalker-recursive_file_permissions' +mod 'puppetlabs-apt' +mod 'puppetlabs-translate' # dependency of puppetlabs-apt +mod 'puppetlabs-inifile' +mod 'puppetlabs-stdlib' +mod 'puppetlabs-yumrepo_core' +mod 'saz-sudo' diff --git a/build/centos7-puppet6/Puppetfile b/build/centos7-puppet6/Puppetfile index 27e33ef2..1da14f1c 100644 --- a/build/centos7-puppet6/Puppetfile +++ b/build/centos7-puppet6/Puppetfile @@ -21,44 +21,44 @@ # ###################### # # Latest Module Tree # # ###################### -# └─┬ stackstorm-st2 (v1.4.0) -# ├── jamtur01-httpauth (v0.0.3) -# ├── puppetlabs-stdlib (v5.2.0) -# ├─┬ puppetlabs-apt (v6.3.0) -# │ └── puppetlabs-translate (v1.2.0) -# ├── saz-sudo (v6.0.0) -# ├─┬ puppet-python (v2.2.2) -# │ └── puppet-epel (v1.3.1) -# ├── puppetlabs-inifile (v2.5.0) -# ├── puppet-mongodb (v2.4.1) -# ├─┬ puppetlabs-postgresql (v5.12.1) -# │ └── puppetlabs-concat (v5.3.0) -# ├─┬ puppet-rabbitmq (v9.0.0) -# │ ├── puppet-archive (v3.2.1) -# │ └── camptocamp-systemd (v2.3.0) +# └─┬ stackstorm-st2 (v1.7.0) # ├── ghoneycutt-facter (v3.5.0) -# ├── puppet-selinux (v1.6.1) -# ├── puppet-nginx (v0.16.0) -# └── puppet-nodejs (v7.0.0) +# ├── jamtur01-httpauth (v0.0.6) +# ├── npwalker-recursive_file_permissions (v0.6.0) +# ├── puppet-epel (v3.0.1) +# ├── puppet-mongodb (v3.1.0) +# ├─┬ puppet-nginx (v1.1.0) +# │ └── puppetlabs-concat (v6.2.0) +# ├── puppet-nodejs (v7.0.1) +# ├── puppet-python (v4.1.1) +# ├─┬ puppet-rabbitmq (v10.1.1) +# │ ├── camptocamp-systemd (v2.9.0) +# │ └── puppet-archive (v4.5.0) +# ├── puppet-selinux (v3.2.0) +# ├─┬ puppetlabs-apt (v7.5.0) +# │ └── puppetlabs-translate (v2.2.0) +# ├── puppetlabs-inifile (v4.2.0) +# ├── puppetlabs-stdlib (v5.2.0) +# ├── puppetlabs-yumrepo_core (v1.0.7) +# └── saz-sudo (v6.0.0) forge "https://forgeapi.puppetlabs.com" +mod 'ghoneycutt-facter' mod 'jamtur01-httpauth' -mod 'puppetlabs-stdlib' -mod 'puppetlabs-apt' -mod 'puppetlabs-yumrepo_core' +mod 'npwalker-recursive_file_permissions' mod 'puppet-epel' -mod 'puppetlabs-translate' # dependency of puppetlabs-apt -mod 'saz-sudo' -mod 'puppet-python' -mod 'puppetlabs-inifile' mod 'puppet-mongodb' -mod 'puppetlabs-postgresql' -mod 'puppetlabs-concat' # dependency of puppetlabs-postgresql +mod 'puppet-nginx' +mod 'puppetlabs-concat' # dependency of puppet-nginx' +mod 'puppet-nodejs' +mod 'puppet-python' mod 'puppet-rabbitmq' -mod 'puppet-archive' # dependency of puppet-rabbitmq mod 'camptocamp-systemd' # dependency of puppet-rabbitmq -mod 'ghoneycutt-facter' +mod 'puppet-archive' # dependency of puppet-rabbitmq mod 'puppet-selinux' -mod 'puppet-nginx' -mod 'puppet-nodejs' -mod 'npwalker-recursive_file_permissions' +mod 'puppetlabs-apt' +mod 'puppetlabs-translate' # dependency of puppetlabs-apt +mod 'puppetlabs-inifile' +mod 'puppetlabs-stdlib' +mod 'puppetlabs-yumrepo_core' +mod 'saz-sudo' diff --git a/build/ubuntu14-puppet5/Dockerfile.kitchen b/build/ubuntu14-puppet5/Dockerfile.kitchen deleted file mode 100644 index 87e1753c..00000000 --- a/build/ubuntu14-puppet5/Dockerfile.kitchen +++ /dev/null @@ -1,40 +0,0 @@ -# usage (from the root of the puppet-st2/ directory): -# docker build -t stackstorm/puppet-st2-ubuntu14-puppet5 -f build/ubuntu14-puppet5/Dockerfile.kitchen . - -FROM stackstorm/packagingtest:trusty-upstart - -# kitchen setup -RUN mkdir -p /var/run/sshd -RUN useradd -d /home/<%= @username %> -m -s /bin/bash <%= @username %> -RUN echo '<%= @username %> ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers -RUN mkdir -p /home/<%= @username %>/.ssh -RUN chown -R <%= @username %> /home/<%= @username %>/.ssh -RUN chmod 0700 /home/<%= @username %>/.ssh -RUN touch /home/<%= @username %>/.ssh/authorized_keys -RUN chown <%= @username %> /home/<%= @username %>/.ssh/authorized_keys -RUN chmod 0600 /home/<%= @username %>/.ssh/authorized_keys -RUN echo '<%= IO.read(@public_key).strip %>' >> /home/<%= @username %>/.ssh/authorized_keys - -# Due to issues with running apt-get during 'docker build' on Ubuntu 14, -# we need to install Puppet once the container has started. -# Do NOT run the following install commands on Ubuntu14, instead let kitchen-puppet -# install Puppet after the container is built. - -# # install puppet -# # https://puppet.com/docs/puppet/5.5/puppet_platform.html#apt-based-systems -# RUN wget https://apt.puppetlabs.com/puppet5-release-trusty.deb -# RUN sudo dpkg -i puppet5-release-trusty.deb -# RUN sudo apt-get update -# RUN sudo apt-get -y install puppet-agent -# RUN sudo apt-get clean - -# # put puppet in our path -# ENV PATH="/opt/puppetlabs/bin:${PATH}" -# RUN ln -s /opt/puppetlabs/bin/facter /usr/bin/ -# RUN ln -s /opt/puppetlabs/bin/hiera /usr/bin/ -# RUN ln -s /opt/puppetlabs/bin/mco /usr/bin/ -# RUN ln -s /opt/puppetlabs/bin/puppet /usr/bin/ - -# # print versions (ruby 2.4.x, puppet 5.x) -# RUN puppet --version -# RUN sudo -E puppet --version diff --git a/build/ubuntu14-puppet5/Puppetfile b/build/ubuntu14-puppet5/Puppetfile deleted file mode 100644 index 27e33ef2..00000000 --- a/build/ubuntu14-puppet5/Puppetfile +++ /dev/null @@ -1,64 +0,0 @@ -# coding: utf-8 -# ################ -# # Instructions # -# ################ -# yum -y install puppet (or equivalent) -# gem install r10k -# # create a new file ./Puppetfile with the contents of this file -# r10k puppetfile install -v --moduledir=./modules --puppetfile=./Puppetfile -# # to check the module dependencies here: -# # puppet module list --tree --modulepath ./modules/ -# puppet apply --modulepath=./modules -e "include st2::profile::fullinstall" -# -# ############# -# # DEV Notes # -# ############# -# # To generate this file i did this, make sure you have this repo cloned: -# pdk build -# puppet module install ./pkg/stackstorm-st2-x.y.z.tar.gz -# puppet module list --tree -# -# ###################### -# # Latest Module Tree # -# ###################### -# └─┬ stackstorm-st2 (v1.4.0) -# ├── jamtur01-httpauth (v0.0.3) -# ├── puppetlabs-stdlib (v5.2.0) -# ├─┬ puppetlabs-apt (v6.3.0) -# │ └── puppetlabs-translate (v1.2.0) -# ├── saz-sudo (v6.0.0) -# ├─┬ puppet-python (v2.2.2) -# │ └── puppet-epel (v1.3.1) -# ├── puppetlabs-inifile (v2.5.0) -# ├── puppet-mongodb (v2.4.1) -# ├─┬ puppetlabs-postgresql (v5.12.1) -# │ └── puppetlabs-concat (v5.3.0) -# ├─┬ puppet-rabbitmq (v9.0.0) -# │ ├── puppet-archive (v3.2.1) -# │ └── camptocamp-systemd (v2.3.0) -# ├── ghoneycutt-facter (v3.5.0) -# ├── puppet-selinux (v1.6.1) -# ├── puppet-nginx (v0.16.0) -# └── puppet-nodejs (v7.0.0) -forge "https://forgeapi.puppetlabs.com" - -mod 'jamtur01-httpauth' -mod 'puppetlabs-stdlib' -mod 'puppetlabs-apt' -mod 'puppetlabs-yumrepo_core' -mod 'puppet-epel' -mod 'puppetlabs-translate' # dependency of puppetlabs-apt -mod 'saz-sudo' -mod 'puppet-python' -mod 'puppetlabs-inifile' -mod 'puppet-mongodb' -mod 'puppetlabs-postgresql' -mod 'puppetlabs-concat' # dependency of puppetlabs-postgresql -mod 'puppet-rabbitmq' -mod 'puppet-archive' # dependency of puppet-rabbitmq -mod 'camptocamp-systemd' # dependency of puppet-rabbitmq -mod 'ghoneycutt-facter' -mod 'puppet-selinux' -mod 'puppet-nginx' -mod 'puppet-nodejs' -mod 'npwalker-recursive_file_permissions' diff --git a/build/ubuntu14-puppet6/Dockerfile.kitchen b/build/ubuntu14-puppet6/Dockerfile.kitchen deleted file mode 100644 index 44b70b38..00000000 --- a/build/ubuntu14-puppet6/Dockerfile.kitchen +++ /dev/null @@ -1,40 +0,0 @@ -# usage (from the root of the puppet-st2/ directory): -# docker build -t stackstorm/puppet-st2-ubuntu14-puppet6 -f build/ubuntu14-puppet6/Dockerfile.kitchen . - -FROM stackstorm/packagingtest:trusty-upstart - -# kitchen setup -RUN mkdir -p /var/run/sshd -RUN useradd -d /home/<%= @username %> -m -s /bin/bash <%= @username %> -RUN echo '<%= @username %> ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers -RUN mkdir -p /home/<%= @username %>/.ssh -RUN chown -R <%= @username %> /home/<%= @username %>/.ssh -RUN chmod 0700 /home/<%= @username %>/.ssh -RUN touch /home/<%= @username %>/.ssh/authorized_keys -RUN chown <%= @username %> /home/<%= @username %>/.ssh/authorized_keys -RUN chmod 0600 /home/<%= @username %>/.ssh/authorized_keys -RUN echo '<%= IO.read(@public_key).strip %>' >> /home/<%= @username %>/.ssh/authorized_keys - -# Due to issues with running apt-get during 'docker build' on Ubuntu 14, -# we need to install Puppet once the container has started. -# Do NOT run the following install commands on Ubuntu14, instead let kitchen-puppet -# install Puppet after the container is built. - -# # install puppet -# # https://puppet.com/docs/puppet/6.0/puppet_platform.html -# RUN wget https://apt.puppetlabs.com/puppet6-release-trusty.deb -# RUN sudo dpkg -i puppet6-release-trusty.deb -# RUN sudo apt-get update -# RUN sudo apt-get -y install puppet-agent -# RUN sudo apt-get clean - -# # put puppet in our path -# ENV PATH="/opt/puppetlabs/bin:${PATH}" -# RUN ln -s /opt/puppetlabs/bin/facter /usr/bin/ -# RUN ln -s /opt/puppetlabs/bin/hiera /usr/bin/ -# RUN ln -s /opt/puppetlabs/bin/mco /usr/bin/ -# RUN ln -s /opt/puppetlabs/bin/puppet /usr/bin/ - -# # print versions (ruby 2.5.x, puppet 6.x) -# RUN puppet --version -# RUN sudo -E puppet --version diff --git a/build/ubuntu14-puppet6/Puppetfile b/build/ubuntu14-puppet6/Puppetfile deleted file mode 100644 index 27e33ef2..00000000 --- a/build/ubuntu14-puppet6/Puppetfile +++ /dev/null @@ -1,64 +0,0 @@ -# coding: utf-8 -# ################ -# # Instructions # -# ################ -# yum -y install puppet (or equivalent) -# gem install r10k -# # create a new file ./Puppetfile with the contents of this file -# r10k puppetfile install -v --moduledir=./modules --puppetfile=./Puppetfile -# # to check the module dependencies here: -# # puppet module list --tree --modulepath ./modules/ -# puppet apply --modulepath=./modules -e "include st2::profile::fullinstall" -# -# ############# -# # DEV Notes # -# ############# -# # To generate this file i did this, make sure you have this repo cloned: -# pdk build -# puppet module install ./pkg/stackstorm-st2-x.y.z.tar.gz -# puppet module list --tree -# -# ###################### -# # Latest Module Tree # -# ###################### -# └─┬ stackstorm-st2 (v1.4.0) -# ├── jamtur01-httpauth (v0.0.3) -# ├── puppetlabs-stdlib (v5.2.0) -# ├─┬ puppetlabs-apt (v6.3.0) -# │ └── puppetlabs-translate (v1.2.0) -# ├── saz-sudo (v6.0.0) -# ├─┬ puppet-python (v2.2.2) -# │ └── puppet-epel (v1.3.1) -# ├── puppetlabs-inifile (v2.5.0) -# ├── puppet-mongodb (v2.4.1) -# ├─┬ puppetlabs-postgresql (v5.12.1) -# │ └── puppetlabs-concat (v5.3.0) -# ├─┬ puppet-rabbitmq (v9.0.0) -# │ ├── puppet-archive (v3.2.1) -# │ └── camptocamp-systemd (v2.3.0) -# ├── ghoneycutt-facter (v3.5.0) -# ├── puppet-selinux (v1.6.1) -# ├── puppet-nginx (v0.16.0) -# └── puppet-nodejs (v7.0.0) -forge "https://forgeapi.puppetlabs.com" - -mod 'jamtur01-httpauth' -mod 'puppetlabs-stdlib' -mod 'puppetlabs-apt' -mod 'puppetlabs-yumrepo_core' -mod 'puppet-epel' -mod 'puppetlabs-translate' # dependency of puppetlabs-apt -mod 'saz-sudo' -mod 'puppet-python' -mod 'puppetlabs-inifile' -mod 'puppet-mongodb' -mod 'puppetlabs-postgresql' -mod 'puppetlabs-concat' # dependency of puppetlabs-postgresql -mod 'puppet-rabbitmq' -mod 'puppet-archive' # dependency of puppet-rabbitmq -mod 'camptocamp-systemd' # dependency of puppet-rabbitmq -mod 'ghoneycutt-facter' -mod 'puppet-selinux' -mod 'puppet-nginx' -mod 'puppet-nodejs' -mod 'npwalker-recursive_file_permissions' diff --git a/build/ubuntu16-puppet5/Puppetfile b/build/ubuntu16-puppet5/Puppetfile index 27e33ef2..1da14f1c 100644 --- a/build/ubuntu16-puppet5/Puppetfile +++ b/build/ubuntu16-puppet5/Puppetfile @@ -21,44 +21,44 @@ # ###################### # # Latest Module Tree # # ###################### -# └─┬ stackstorm-st2 (v1.4.0) -# ├── jamtur01-httpauth (v0.0.3) -# ├── puppetlabs-stdlib (v5.2.0) -# ├─┬ puppetlabs-apt (v6.3.0) -# │ └── puppetlabs-translate (v1.2.0) -# ├── saz-sudo (v6.0.0) -# ├─┬ puppet-python (v2.2.2) -# │ └── puppet-epel (v1.3.1) -# ├── puppetlabs-inifile (v2.5.0) -# ├── puppet-mongodb (v2.4.1) -# ├─┬ puppetlabs-postgresql (v5.12.1) -# │ └── puppetlabs-concat (v5.3.0) -# ├─┬ puppet-rabbitmq (v9.0.0) -# │ ├── puppet-archive (v3.2.1) -# │ └── camptocamp-systemd (v2.3.0) +# └─┬ stackstorm-st2 (v1.7.0) # ├── ghoneycutt-facter (v3.5.0) -# ├── puppet-selinux (v1.6.1) -# ├── puppet-nginx (v0.16.0) -# └── puppet-nodejs (v7.0.0) +# ├── jamtur01-httpauth (v0.0.6) +# ├── npwalker-recursive_file_permissions (v0.6.0) +# ├── puppet-epel (v3.0.1) +# ├── puppet-mongodb (v3.1.0) +# ├─┬ puppet-nginx (v1.1.0) +# │ └── puppetlabs-concat (v6.2.0) +# ├── puppet-nodejs (v7.0.1) +# ├── puppet-python (v4.1.1) +# ├─┬ puppet-rabbitmq (v10.1.1) +# │ ├── camptocamp-systemd (v2.9.0) +# │ └── puppet-archive (v4.5.0) +# ├── puppet-selinux (v3.2.0) +# ├─┬ puppetlabs-apt (v7.5.0) +# │ └── puppetlabs-translate (v2.2.0) +# ├── puppetlabs-inifile (v4.2.0) +# ├── puppetlabs-stdlib (v5.2.0) +# ├── puppetlabs-yumrepo_core (v1.0.7) +# └── saz-sudo (v6.0.0) forge "https://forgeapi.puppetlabs.com" +mod 'ghoneycutt-facter' mod 'jamtur01-httpauth' -mod 'puppetlabs-stdlib' -mod 'puppetlabs-apt' -mod 'puppetlabs-yumrepo_core' +mod 'npwalker-recursive_file_permissions' mod 'puppet-epel' -mod 'puppetlabs-translate' # dependency of puppetlabs-apt -mod 'saz-sudo' -mod 'puppet-python' -mod 'puppetlabs-inifile' mod 'puppet-mongodb' -mod 'puppetlabs-postgresql' -mod 'puppetlabs-concat' # dependency of puppetlabs-postgresql +mod 'puppet-nginx' +mod 'puppetlabs-concat' # dependency of puppet-nginx' +mod 'puppet-nodejs' +mod 'puppet-python' mod 'puppet-rabbitmq' -mod 'puppet-archive' # dependency of puppet-rabbitmq mod 'camptocamp-systemd' # dependency of puppet-rabbitmq -mod 'ghoneycutt-facter' +mod 'puppet-archive' # dependency of puppet-rabbitmq mod 'puppet-selinux' -mod 'puppet-nginx' -mod 'puppet-nodejs' -mod 'npwalker-recursive_file_permissions' +mod 'puppetlabs-apt' +mod 'puppetlabs-translate' # dependency of puppetlabs-apt +mod 'puppetlabs-inifile' +mod 'puppetlabs-stdlib' +mod 'puppetlabs-yumrepo_core' +mod 'saz-sudo' diff --git a/build/ubuntu16-puppet6/Puppetfile b/build/ubuntu16-puppet6/Puppetfile index 27e33ef2..1da14f1c 100644 --- a/build/ubuntu16-puppet6/Puppetfile +++ b/build/ubuntu16-puppet6/Puppetfile @@ -21,44 +21,44 @@ # ###################### # # Latest Module Tree # # ###################### -# └─┬ stackstorm-st2 (v1.4.0) -# ├── jamtur01-httpauth (v0.0.3) -# ├── puppetlabs-stdlib (v5.2.0) -# ├─┬ puppetlabs-apt (v6.3.0) -# │ └── puppetlabs-translate (v1.2.0) -# ├── saz-sudo (v6.0.0) -# ├─┬ puppet-python (v2.2.2) -# │ └── puppet-epel (v1.3.1) -# ├── puppetlabs-inifile (v2.5.0) -# ├── puppet-mongodb (v2.4.1) -# ├─┬ puppetlabs-postgresql (v5.12.1) -# │ └── puppetlabs-concat (v5.3.0) -# ├─┬ puppet-rabbitmq (v9.0.0) -# │ ├── puppet-archive (v3.2.1) -# │ └── camptocamp-systemd (v2.3.0) +# └─┬ stackstorm-st2 (v1.7.0) # ├── ghoneycutt-facter (v3.5.0) -# ├── puppet-selinux (v1.6.1) -# ├── puppet-nginx (v0.16.0) -# └── puppet-nodejs (v7.0.0) +# ├── jamtur01-httpauth (v0.0.6) +# ├── npwalker-recursive_file_permissions (v0.6.0) +# ├── puppet-epel (v3.0.1) +# ├── puppet-mongodb (v3.1.0) +# ├─┬ puppet-nginx (v1.1.0) +# │ └── puppetlabs-concat (v6.2.0) +# ├── puppet-nodejs (v7.0.1) +# ├── puppet-python (v4.1.1) +# ├─┬ puppet-rabbitmq (v10.1.1) +# │ ├── camptocamp-systemd (v2.9.0) +# │ └── puppet-archive (v4.5.0) +# ├── puppet-selinux (v3.2.0) +# ├─┬ puppetlabs-apt (v7.5.0) +# │ └── puppetlabs-translate (v2.2.0) +# ├── puppetlabs-inifile (v4.2.0) +# ├── puppetlabs-stdlib (v5.2.0) +# ├── puppetlabs-yumrepo_core (v1.0.7) +# └── saz-sudo (v6.0.0) forge "https://forgeapi.puppetlabs.com" +mod 'ghoneycutt-facter' mod 'jamtur01-httpauth' -mod 'puppetlabs-stdlib' -mod 'puppetlabs-apt' -mod 'puppetlabs-yumrepo_core' +mod 'npwalker-recursive_file_permissions' mod 'puppet-epel' -mod 'puppetlabs-translate' # dependency of puppetlabs-apt -mod 'saz-sudo' -mod 'puppet-python' -mod 'puppetlabs-inifile' mod 'puppet-mongodb' -mod 'puppetlabs-postgresql' -mod 'puppetlabs-concat' # dependency of puppetlabs-postgresql +mod 'puppet-nginx' +mod 'puppetlabs-concat' # dependency of puppet-nginx' +mod 'puppet-nodejs' +mod 'puppet-python' mod 'puppet-rabbitmq' -mod 'puppet-archive' # dependency of puppet-rabbitmq mod 'camptocamp-systemd' # dependency of puppet-rabbitmq -mod 'ghoneycutt-facter' +mod 'puppet-archive' # dependency of puppet-rabbitmq mod 'puppet-selinux' -mod 'puppet-nginx' -mod 'puppet-nodejs' -mod 'npwalker-recursive_file_permissions' +mod 'puppetlabs-apt' +mod 'puppetlabs-translate' # dependency of puppetlabs-apt +mod 'puppetlabs-inifile' +mod 'puppetlabs-stdlib' +mod 'puppetlabs-yumrepo_core' +mod 'saz-sudo' diff --git a/build/ubuntu18-puppet5/Puppetfile b/build/ubuntu18-puppet5/Puppetfile index 456b2056..1da14f1c 100644 --- a/build/ubuntu18-puppet5/Puppetfile +++ b/build/ubuntu18-puppet5/Puppetfile @@ -21,45 +21,44 @@ # ###################### # # Latest Module Tree # # ###################### -# └─┬ stackstorm-st2 (v1.4.0) -# ├── jamtur01-httpauth (v0.0.3) -# ├── puppetlabs-stdlib (v5.2.0) -# ├─┬ puppetlabs-apt (v6.3.0) -# │ └── puppetlabs-translate (v1.2.0) -# ├── saz-sudo (v6.0.0) -# ├─┬ puppet-python (v2.2.2) -# │ └── puppet-epel (v1.3.1) -# ├── puppetlabs-inifile (v2.5.0) -# ├── puppet-mongodb (v2.4.1) -# ├─┬ puppetlabs-postgresql (v5.12.1) -# │ └── puppetlabs-concat (v5.3.0) -# ├─┬ puppet-rabbitmq (v9.0.0) -# │ ├── puppet-archive (v3.2.1) -# │ └── camptocamp-systemd (v2.3.0) +# └─┬ stackstorm-st2 (v1.7.0) # ├── ghoneycutt-facter (v3.5.0) -# ├── computology-packagecloud (v0.3.2) -# ├── puppet-selinux (v1.6.1) -# ├── puppet-nginx (v0.16.0) -# └── puppet-nodejs (v7.0.0) +# ├── jamtur01-httpauth (v0.0.6) +# ├── npwalker-recursive_file_permissions (v0.6.0) +# ├── puppet-epel (v3.0.1) +# ├── puppet-mongodb (v3.1.0) +# ├─┬ puppet-nginx (v1.1.0) +# │ └── puppetlabs-concat (v6.2.0) +# ├── puppet-nodejs (v7.0.1) +# ├── puppet-python (v4.1.1) +# ├─┬ puppet-rabbitmq (v10.1.1) +# │ ├── camptocamp-systemd (v2.9.0) +# │ └── puppet-archive (v4.5.0) +# ├── puppet-selinux (v3.2.0) +# ├─┬ puppetlabs-apt (v7.5.0) +# │ └── puppetlabs-translate (v2.2.0) +# ├── puppetlabs-inifile (v4.2.0) +# ├── puppetlabs-stdlib (v5.2.0) +# ├── puppetlabs-yumrepo_core (v1.0.7) +# └── saz-sudo (v6.0.0) forge "https://forgeapi.puppetlabs.com" +mod 'ghoneycutt-facter' mod 'jamtur01-httpauth' -mod 'puppetlabs-apt' -mod 'puppetlabs-yumrepo_core' +mod 'npwalker-recursive_file_permissions' mod 'puppet-epel' -mod 'puppetlabs-translate' # dependency of puppetlabs-apt -mod 'saz-sudo' -mod 'puppet-python' mod 'puppet-mongodb' -mod 'puppetlabs-postgresql' -mod 'puppetlabs-concat' # dependency of puppetlabs-postgresql +mod 'puppet-nginx' +mod 'puppetlabs-concat' # dependency of puppet-nginx' +mod 'puppet-nodejs' +mod 'puppet-python' mod 'puppet-rabbitmq' -mod 'puppet-archive' # dependency of puppet-rabbitmq mod 'camptocamp-systemd' # dependency of puppet-rabbitmq -mod 'ghoneycutt-facter' +mod 'puppet-archive' # dependency of puppet-rabbitmq mod 'puppet-selinux' -mod 'puppet-nginx' -mod 'puppet-nodejs' +mod 'puppetlabs-apt' +mod 'puppetlabs-translate' # dependency of puppetlabs-apt mod 'puppetlabs-inifile' mod 'puppetlabs-stdlib' -mod 'npwalker-recursive_file_permissions' +mod 'puppetlabs-yumrepo_core' +mod 'saz-sudo' diff --git a/build/ubuntu18-puppet6/Puppetfile b/build/ubuntu18-puppet6/Puppetfile index 456b2056..1da14f1c 100644 --- a/build/ubuntu18-puppet6/Puppetfile +++ b/build/ubuntu18-puppet6/Puppetfile @@ -21,45 +21,44 @@ # ###################### # # Latest Module Tree # # ###################### -# └─┬ stackstorm-st2 (v1.4.0) -# ├── jamtur01-httpauth (v0.0.3) -# ├── puppetlabs-stdlib (v5.2.0) -# ├─┬ puppetlabs-apt (v6.3.0) -# │ └── puppetlabs-translate (v1.2.0) -# ├── saz-sudo (v6.0.0) -# ├─┬ puppet-python (v2.2.2) -# │ └── puppet-epel (v1.3.1) -# ├── puppetlabs-inifile (v2.5.0) -# ├── puppet-mongodb (v2.4.1) -# ├─┬ puppetlabs-postgresql (v5.12.1) -# │ └── puppetlabs-concat (v5.3.0) -# ├─┬ puppet-rabbitmq (v9.0.0) -# │ ├── puppet-archive (v3.2.1) -# │ └── camptocamp-systemd (v2.3.0) +# └─┬ stackstorm-st2 (v1.7.0) # ├── ghoneycutt-facter (v3.5.0) -# ├── computology-packagecloud (v0.3.2) -# ├── puppet-selinux (v1.6.1) -# ├── puppet-nginx (v0.16.0) -# └── puppet-nodejs (v7.0.0) +# ├── jamtur01-httpauth (v0.0.6) +# ├── npwalker-recursive_file_permissions (v0.6.0) +# ├── puppet-epel (v3.0.1) +# ├── puppet-mongodb (v3.1.0) +# ├─┬ puppet-nginx (v1.1.0) +# │ └── puppetlabs-concat (v6.2.0) +# ├── puppet-nodejs (v7.0.1) +# ├── puppet-python (v4.1.1) +# ├─┬ puppet-rabbitmq (v10.1.1) +# │ ├── camptocamp-systemd (v2.9.0) +# │ └── puppet-archive (v4.5.0) +# ├── puppet-selinux (v3.2.0) +# ├─┬ puppetlabs-apt (v7.5.0) +# │ └── puppetlabs-translate (v2.2.0) +# ├── puppetlabs-inifile (v4.2.0) +# ├── puppetlabs-stdlib (v5.2.0) +# ├── puppetlabs-yumrepo_core (v1.0.7) +# └── saz-sudo (v6.0.0) forge "https://forgeapi.puppetlabs.com" +mod 'ghoneycutt-facter' mod 'jamtur01-httpauth' -mod 'puppetlabs-apt' -mod 'puppetlabs-yumrepo_core' +mod 'npwalker-recursive_file_permissions' mod 'puppet-epel' -mod 'puppetlabs-translate' # dependency of puppetlabs-apt -mod 'saz-sudo' -mod 'puppet-python' mod 'puppet-mongodb' -mod 'puppetlabs-postgresql' -mod 'puppetlabs-concat' # dependency of puppetlabs-postgresql +mod 'puppet-nginx' +mod 'puppetlabs-concat' # dependency of puppet-nginx' +mod 'puppet-nodejs' +mod 'puppet-python' mod 'puppet-rabbitmq' -mod 'puppet-archive' # dependency of puppet-rabbitmq mod 'camptocamp-systemd' # dependency of puppet-rabbitmq -mod 'ghoneycutt-facter' +mod 'puppet-archive' # dependency of puppet-rabbitmq mod 'puppet-selinux' -mod 'puppet-nginx' -mod 'puppet-nodejs' +mod 'puppetlabs-apt' +mod 'puppetlabs-translate' # dependency of puppetlabs-apt mod 'puppetlabs-inifile' mod 'puppetlabs-stdlib' -mod 'npwalker-recursive_file_permissions' +mod 'puppetlabs-yumrepo_core' +mod 'saz-sudo' diff --git a/manifests/init.pp b/manifests/init.pp index 04ef0e4a..ef6506cc 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -71,20 +71,6 @@ # Name of the group that will own the /opt/stackstorm/packs directory (default: st2packs) # @param index_url # Url to the StackStorm Exchange index file. (default undef) -# @param mistral_db_host -# Hostname/IP of the Mistral Postgres database -# @param mistral_db_name -# Database name of the Mistral Postgres database -# @param mistral_db_username -# Username for authentication to the Mistral Postgres database -# @param mistral_db_password -# Password for authentication to the Mistral Postgres database -# @param mistral_db_bind_ips -# String of IPs (csv) that the Mistral Postgres database -# will accept connections on (default: 127.0.0.1) -# @param mistral_manage -# If this module should manage the Mistral install and services (st2mistral and postgres). -# (default: true if Ubuntu <= 16.04 or CentOS <= 7, false otherwise) # @param syslog # Routes all log messages to syslog # @param syslog_host @@ -226,7 +212,7 @@ # version => '2.10.1', # } # -# @example Different passwords for each database (MongoDB, RabbitMQ, Postgres) +# @example Different passwords for each database (MongoDB, RabbitMQ) # class { 'st2': # # StackStorm user # cli_username => 'st2admin', @@ -237,9 +223,6 @@ # # RabbitMQ user for StackStorm # rabbitmq_username => 'st2', # rabbitmq_password => '@!fsdf0#45', -# # Postrgres user for Mistral -# mistral_db_username => 'stackstorm', -# mistral_db_password => 'FSDfcds#45w', # } # class st2( @@ -271,12 +254,6 @@ $packs = {}, $packs_group = $::st2::params::packs_group_name, $index_url = undef, - $mistral_db_host = $::st2::params::hostname, - $mistral_db_name = $::st2::params::mistral_db_name, - $mistral_db_username = $::st2::params::mistral_db_username, - $mistral_db_password = $::st2::params::admin_password, - $mistral_db_bind_ips = $::st2::params::mistral_db_bind_ips, - $mistral_manage = $st2::params::mistral_manage, $syslog = false, $syslog_host = 'localhost', $syslog_protocol = 'udp', diff --git a/manifests/params.pp b/manifests/params.pp index 6594bc18..34a4f8e1 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -57,9 +57,6 @@ $st2_chatops_packages = [ 'st2chatops', ] - $st2_mistral_packages = [ - 'st2mistral', - ] $st2_web_packages = [ 'st2web', ] @@ -161,34 +158,6 @@ $mongodb_st2_username = 'stackstorm' $mongodb_st2_roles = ['readWrite'] - ## Mistral data - $mistral_db_name = 'mistral' - $mistral_db_username = 'mistral' - $mistral_db_bind_ips = '127.0.0.1' - case $facts['os']['family'] { - 'Debian': { - # don't install Mistral in Ubuntu 18.04 and newer - if versioncmp($facts['os']['release']['major'], '18.04') >= 0 { - $mistral_manage = false - } - else { - $mistral_manage = true - } - } - 'RedHat': { - # don't install Mistral in Red Hat 8 and newer - if versioncmp($facts['os']['release']['major'], '8') >= 0 { - $mistral_manage = false - } - else { - $mistral_manage = true - } - } - default: { - $mistral_manage = false - } - } - ## RabbitMQ $rabbitmq_username = $admin_username $rabbitmq_password = $admin_password diff --git a/manifests/profile/fullinstall.pp b/manifests/profile/fullinstall.pp index 44c596a2..c09b263e 100644 --- a/manifests/profile/fullinstall.pp +++ b/manifests/profile/fullinstall.pp @@ -6,8 +6,6 @@ # * MongoDB # * NodeJS # * nginx -# * PostgreSQL (required by Mistral) -# * Mistral # # @example Basic Usage # include st2::profile::fullinstall @@ -35,11 +33,9 @@ -> class { 'st2::profile::selinux': } -> Anchor['st2::pre_reqs'] -> class { 'st2::profile::nodejs': } - -> class { 'st2::profile::postgresql': } -> class { 'st2::profile::rabbitmq': } -> class { 'st2::profile::mongodb': } -> Anchor['st2::main'] - -> class { 'st2::profile::mistral': } -> class { 'st2::profile::client': } -> class { 'st2::profile::server': } -> class { 'st2::profile::web': } diff --git a/manifests/profile/mistral.pp b/manifests/profile/mistral.pp deleted file mode 100644 index 4f48dc3d..00000000 --- a/manifests/profile/mistral.pp +++ /dev/null @@ -1,167 +0,0 @@ -# @summary This class installs OpenStack Mistral, a workflow engine that integrates with StackStorm. -# -# @param version -# Version of the st2mistral package to install -# @param db_host -# Server hosting Mistral Postgres DB -# @param db_name -# Name of the Mistral Postgres database -# @param db_username -# Mistral user for authenticating with PostgreSQL -# @param db_password -# Mistral password for authenticating with PostgreSQL -# @param manage -# If this module should manage the st2mistral install and service -# (default: true if Ubuntu <= 16.04 or CentOS <= 7, false otherwise) -# @param rabbitmq_username -# Username for authenticating with RabbitMQ -# @param rabbitmq_password -# Password for authenticating with RabbitMQ -# @param rabbitmq_hostname -# Hostname/IP of the RabbitMQ server -# @param rabbitmq_port -# Port for connecting to RabbitMQ -# @param rabbitmq_vhost -# RabbitMQ virtual host for Mistral -# -# @example Basic Usage -# include st2::profile::mistral -# -# @example External database -# class { 'st2::profile::mistral': -# db_host => 'postgres.domain.tld', -# db_username => 'mistral', -# db_password => 'xyz123', -# } -# -# @example External RabbitMQ -# class { 'st2::profile::mistral': -# rabbitmq_hostname => 'rabbitmq.domain.tld', -# rabbitmq_username => 'mistral', -# rabbitmq_password => 'xyz123', -# } -# -class st2::profile::mistral( - $version = $::st2::version, - $db_host = $::st2::mistral_db_host, - $db_name = $::st2::mistral_db_name, - $db_username = $::st2::mistral_db_username, - $db_password = $::st2::mistral_db_password, - $manage = $::st2::mistral_manage, - $rabbitmq_username = $::st2::rabbitmq_username, - $rabbitmq_password = $::st2::rabbitmq_password, - $rabbitmq_hostname = $::st2::rabbitmq_hostname, - $rabbitmq_port = $::st2::rabbitmq_port, - $rabbitmq_vhost = $::st2::rabbitmq_vhost, -) inherits st2 { - include st2::params - - if $manage { - ### Mistral Variables ### - $mistral_root = '/opt/stackstorm/mistral' - $mistral_config = '/etc/mistral/mistral.conf' - ### End Mistral Variables ### - - ### Mistral Packages ### - package { $st2::params::st2_mistral_packages: - ensure => $version, - tag => ['st2::packages', 'st2::mistral::packages'], - } - ### End Mistral Packages ### - - ### Mistral Config ### - # URL encode the password, in case it contains special characters that - # can mess up the URL in the config. - $_db_password = st2::urlencode($db_password) - ini_setting { 'database_connection': - ensure => present, - path => $mistral_config, - section => 'database', - setting => 'connection', - value => "postgresql://${db_username}:${_db_password}@${db_host}/${db_name}", - tag => 'mistral', - } - - # URL encode the RabbitMQ password, in case it contains special characters that - # can mess up the URL. - $_rabbitmq_pass = st2::urlencode($rabbitmq_password) - ini_setting { 'DEFAULT_transport_url': - ensure => present, - path => $mistral_config, - section => 'DEFAULT', - setting => 'transport_url', - value => "rabbit://${rabbitmq_username}:${_rabbitmq_pass}@${rabbitmq_hostname}:${rabbitmq_port}/${rabbitmq_vhost}", - tag => 'mistral', - } - - - # TODO add extra config params - # https://forge.puppet.com/puppetlabs/inifile - # create_ini_settings() - ### End Mistral Config ### - - ### Setup Mistral Database ### - postgresql::server::role { $db_username: - password_hash => postgresql_password($db_username, $db_password), - createdb => true, - before => Postgresql::Server::Database[$db_name], - require => Class['postgresql::server'], - } - - postgresql::server::database { $db_name: - owner => $db_username, - } - - if str2bool($::mistral_bootstrapped) != true { - exec { 'setup mistral database': - command => "mistral-db-manage --config-file ${mistral_config} upgrade head", - refreshonly => true, - path => ["${mistral_root}/bin"], - require => [Postgresql::Server::Role[$db_username], - Ini_Setting['database_connection']], - subscribe => Postgresql::Server::Database[$db_name], - before => Facter::Fact['mistral_bootstrapped'], - notify => [Exec['populate mistral database'], - Service['mistral']], - } - - exec { 'populate mistral database': - command => "mistral-db-manage --config-file ${mistral_config} populate", - refreshonly => true, - path => ["${mistral_root}/bin"], - subscribe => Exec['setup mistral database'], - before => Facter::Fact['mistral_bootstrapped'], - notify => Service['mistral'], - } - } - ### End Mistral Database ### - - # Once everything is done, let the system know so we can avoid some future processing - facter::fact { 'mistral_bootstrapped': - value => bool2str(true), - } - - ### Setup Mistral Service ### - # this is a "meta-service" for mistral-server and mistral-api - service { 'mistral': - ensure => running, - enable => true, - } - ### End Mistral Service ### - - - ### Setup Dependencies ### - - # Setup refresh events on config change for mistral - Ini_setting<| tag == 'mistral' |> ~> Service['mistral'] - - # Setup dependencies between actions in this profile - Package<| tag == 'st2::mistral::packages' |> - -> Ini_setting <| tag == 'mistral' |> - -> Postgresql::Server::Database[$db_name] - -> Facter::Fact['mistral_bootstrapped'] - -> Service['mistral'] - - ### End Dependencies ### - } -} diff --git a/manifests/profile/postgresql.pp b/manifests/profile/postgresql.pp deleted file mode 100644 index 5f503890..00000000 --- a/manifests/profile/postgresql.pp +++ /dev/null @@ -1,26 +0,0 @@ -# @summary st2 compatable installation of PostgreSQL and dependencies for use with StackStorm and Mistral. -# -# @param bind_ips -# String of IPs (csv) that the Postgres database will accept connections on. -# @param manage -# If this module should manage the postgres install and service -# (default: true if Ubuntu <= 16.04 or CentOS <= 7, false otherwise) -# -# @example Basic usage -# include st2::profile::postgresql -# -# @example Customizing parameters -# class { 'st2::profile::postgresql': -# db_bind_ips => '0.0.0.0', -# } -# -class st2::profile::postgresql( - $bind_ips = $::st2::mistral_db_bind_ips, - $manage = $::st2::mistral_manage, -) inherits st2 { - if $manage and !defined(Class['postgresql::server']) { - class { 'postgresql::server': - listen_addresses => $bind_ips, - } - } -} diff --git a/metadata.json b/metadata.json index 9a4fb628..272b1ecf 100644 --- a/metadata.json +++ b/metadata.json @@ -44,10 +44,6 @@ "name": "puppet/mongodb", "version_requirement": ">= 3.1.0 < 4.0.0" }, - { - "name": "puppetlabs/postgresql", - "version_requirement": ">= 4.4.2 < 7.0.0" - }, { "name": "puppet/rabbitmq", "version_requirement": ">= 4.1.0 < 11.0.0" diff --git a/spec/defines/auth_user_spec.rb b/spec/defines/auth_user_spec.rb index 775e57ce..aaaa6ff3 100644 --- a/spec/defines/auth_user_spec.rb +++ b/spec/defines/auth_user_spec.rb @@ -1,23 +1,24 @@ require 'spec_helper' -require 'helpers/fact_helper' describe 'st2::auth_user' do let(:title) { 'stanley' } - describe 'creates an htpasswd entry' do - let(:facts) { FactHelper.ubuntu_trusty_x64 } - let(:params) do - { - ensure: 'present', - password: 'sekritp3sswrd', - } - end + on_supported_os.each do |os, os_facts| + let(:facts) { os_facts } + + describe "on #{os} creates an htpasswd entry" do + let(:params) do + { + ensure: 'present', + password: 'sekritp3sswrd', + } + end - it do - is_expected.to contain_httpauth('stanley').with( - ensure: 'present', - password: 'sekritp3sswrd', - ) + it do + is_expected.to contain_httpauth('stanley') + .with(ensure: 'present', + password: 'sekritp3sswrd') + end end end end diff --git a/spec/defines/pack_spec.rb b/spec/defines/pack_spec.rb index 9e2fb300..69a5236e 100644 --- a/spec/defines/pack_spec.rb +++ b/spec/defines/pack_spec.rb @@ -1,98 +1,74 @@ require 'spec_helper' -require 'helpers/fact_helper' describe 'st2::pack' do let(:title) { 'st2testpack' } - let(:facts) do - { - os: { - family: 'RedHat', - release: { - major: '7', - }, - }, - operatingsystem: 'RedHat', - osfamily: 'RedHat', - operatingsystemmajrelease: '7', - } - end - context 'when declared with config' do - let(:params) do - { - repo_url: 'https://git.company.com/repos/packs/pack.git', - config: { - foo: 'bar', - }, - } - end + on_supported_os.each do |os, os_facts| + let(:facts) { os_facts } - it do - is_expected.to contain_st2_pack('st2testpack') - end + context "on #{os}" do + context 'when declared with config' do + let(:params) do + { + repo_url: 'https://git.company.com/repos/packs/pack.git', + config: { + foo: 'bar', + }, + } + end - it do - is_expected.to contain_file('/opt/stackstorm/configs/st2testpack.yaml').with( - ensure: 'file', - owner: 'st2', - group: 'root', - mode: '0640', - ) - end - end + it { is_expected.to contain_st2_pack('st2testpack') } + it do + is_expected.to contain_file('/opt/stackstorm/configs/st2testpack.yaml') + .with(ensure: 'file', + owner: 'st2', + group: 'root', + mode: '0640') + end + end - context 'when declared with default parameters' do - it do - is_expected.to contain_st2_pack('st2testpack').with( - ensure: 'present', - user: 'st2admin', - password: 'Ch@ngeMe', - ) - end - end + context 'when declared with default parameters' do + it do + is_expected.to contain_st2_pack('st2testpack') + .with(ensure: 'present', + user: 'st2admin', + password: 'Ch@ngeMe') + end + end - context 'when declared with explicit source' do - let(:params) do - { - repo_url: 'https://git.company.com/repos/packs/pack.git', - } - end + context 'when declared with explicit source' do + let(:params) { { repo_url: 'https://git.company.com/repos/packs/pack.git' } } - it do - is_expected.to contain_st2_pack('st2testpack').with( - ensure: 'present', - user: 'st2admin', - password: 'Ch@ngeMe', - source: 'https://git.company.com/repos/packs/pack.git', - ) - end - end + it do + is_expected.to contain_st2_pack('st2testpack') + .with(ensure: 'present', + user: 'st2admin', + password: 'Ch@ngeMe', + source: 'https://git.company.com/repos/packs/pack.git') + end + end - context 'when declared with non-default user and password' do - let(:pre_condition) { 'class {"st2": cli_password => "test_bar", cli_username => "test_foo"}' } + context 'when declared with non-default user and password' do + let(:pre_condition) { 'class {"st2": cli_password => "test_bar", cli_username => "test_foo"}' } - it do - is_expected.to contain_st2_pack('st2testpack').with( - ensure: 'present', - user: 'test_foo', - password: 'test_bar', - ) - end - end + it do + is_expected.to contain_st2_pack('st2testpack') + .with(ensure: 'present', + user: 'test_foo', + password: 'test_bar') + end + end - context 'when defining a package absent' do - let(:params) do - { - ensure: 'absent', - } - end + context 'when defining a package absent' do + let(:params) { { ensure: 'absent' } } - it do - is_expected.to contain_st2_pack('st2testpack').with( - ensure: 'absent', - user: 'st2admin', - password: 'Ch@ngeMe', - ) + it do + is_expected.to contain_st2_pack('st2testpack') + .with(ensure: 'absent', + user: 'st2admin', + password: 'Ch@ngeMe') + end + end end end end diff --git a/spec/functions/version_ge_spec.rb b/spec/functions/version_ge_spec.rb index 93605273..18786e73 100644 --- a/spec/functions/version_ge_spec.rb +++ b/spec/functions/version_ge_spec.rb @@ -3,172 +3,94 @@ require 'spec_helper' describe 'st2::version_ge' do - context 'when StackStorm is not installed' do - let(:facts) do - { - st2_version: nil, - os: { - family: 'RedHat', - release: { - major: '7', - }, - }, - } - end - - it 'comparing with any version returns true' do - is_expected.to run.with_params('2.10.0').and_return(true) - end - end - - context 'when StackStorm is installed' do - context 'and st2::version = "present"' do - let(:pre_condition) { "class {'st2': version => 'present' }" } - let(:facts) do - { - st2_version: '2.9.0', - 'st2::version' => 'present', - osfamily: 'RedHat', - os: { - family: 'RedHat', - release: { - major: '7', - }, - }, - } - end - - it 'comparing with higher version returns false' do - is_expected.to run.with_params('2.10.0').and_return(false) - end - - it 'comparing with lower version returns true' do - is_expected.to run.with_params('2.8.0').and_return(true) - end - end - - context 'and st2::version = "installed"' do - let(:pre_condition) { "class {'st2': version => 'installed' }" } - let(:facts) do - { - st2_version: '2.9.0', - 'st2::version' => 'installed', - osfamily: 'RedHat', - os: { - family: 'RedHat', - release: { - major: '7', - }, - }, - } - end - - it 'comparing with higher version (2.10.0) returns false' do - is_expected.to run.with_params('2.10.0').and_return(false) - end - - it 'comparing with lower version (2.8.0) returns true' do - is_expected.to run.with_params('2.8.0').and_return(true) - end - end - - context 'and st2::version = "latest"' do - let(:pre_condition) { "class {'st2': version => 'latest' }" } - let(:facts) do - { - st2_version: '2.9.0', - 'st2::version' => 'latest', - osfamily: 'RedHat', - os: { - family: 'RedHat', - release: { - major: '7', - }, - }, - } - end - - it 'comparing with higher version (2.10.0) returns true' do - is_expected.to run.with_params('2.10.0').and_return(true) - end - - it 'comparing with lower version (2.8.0) returns true' do - is_expected.to run.with_params('2.8.0').and_return(true) - end - end - - context 'and st2_version = "2.9.0" st2::version = "2.9.0"' do - let(:pre_condition) { "class {'st2': version => '2.9.0' }" } - let(:facts) do - { - st2_version: '2.9.0', - 'st2::version' => '2.9.0', - osfamily: 'RedHat', - os: { - family: 'RedHat', - release: { - major: '7', - }, - }, - } - end - - it 'comparing with higher version (2.10.0) returns false' do - is_expected.to run.with_params('2.10.0').and_return(false) - end - - it 'comparing with lower version (2.8.0) returns true' do - is_expected.to run.with_params('2.8.0').and_return(true) - end - end - - context 'and st2_version = "2.9.0" st2::version = "2.10.0"' do - let(:pre_condition) { "class {'st2': version => '2.10.0' }" } - let(:facts) do - { - st2_version: '2.9.0', - 'st2::version' => '2.10.0', - osfamily: 'RedHat', - os: { - family: 'RedHat', - release: { - major: '7', - }, - }, - } - end - - it 'comparing with higher version (2.11.0) returns false' do - is_expected.to run.with_params('2.11.0').and_return(false) - end - - it 'comparing with lower version (2.8.0) returns true' do - is_expected.to run.with_params('2.8.0').and_return(true) - end - end - - context 'and st2_version = "2.10.0" st2::version = "2.9.0"' do - let(:pre_condition) { "class {'st2': version => '2.9.0' }" } - let(:facts) do - { - st2_version: '2.10.0', - 'st2::version' => '2.9.0', - osfamily: 'RedHat', - os: { - family: 'RedHat', - release: { - major: '7', - }, - }, - } - end - - it 'comparing with higher version (2.11.0) returns false' do - is_expected.to run.with_params('2.11.0').and_return(false) - end - - it 'comparing with lower version (2.8.0) returns true' do - is_expected.to run.with_params('2.8.0').and_return(true) + on_supported_os.each do |os, os_facts| + context "on #{os}" do + context 'when StackStorm is not installed' do + let(:facts) { os_facts.merge(st2_version: nil) } + + it 'comparing with any version returns true' do + is_expected.to run.with_params('2.10.0').and_return(true) + end + end + + context 'when StackStorm is installed' do + context 'and st2::version = "present"' do + let(:pre_condition) { "class {'st2': version => 'present' }" } + let(:facts) { os_facts.merge(st2_version: '2.9.0', 'st2::version' => 'present') } + + it 'comparing with higher version returns false' do + is_expected.to run.with_params('2.10.0').and_return(false) + end + + it 'comparing with lower version returns true' do + is_expected.to run.with_params('2.8.0').and_return(true) + end + end + + context 'and st2::version = "installed"' do + let(:pre_condition) { "class {'st2': version => 'installed' }" } + let(:facts) { os_facts.merge(st2_version: '2.9.0', 'st2::version' => 'installed') } + + it 'comparing with higher version (2.10.0) returns false' do + is_expected.to run.with_params('2.10.0').and_return(false) + end + + it 'comparing with lower version (2.8.0) returns true' do + is_expected.to run.with_params('2.8.0').and_return(true) + end + end + + context 'and st2::version = "latest"' do + let(:pre_condition) { "class {'st2': version => 'latest' }" } + let(:facts) { os_facts.merge(st2_version: '2.9.0', 'st2::version' => 'latest') } + + it 'comparing with higher version (2.10.0) returns true' do + is_expected.to run.with_params('2.10.0').and_return(true) + end + + it 'comparing with lower version (2.8.0) returns true' do + is_expected.to run.with_params('2.8.0').and_return(true) + end + end + + context 'and st2_version = "2.9.0" st2::version = "2.9.0"' do + let(:pre_condition) { "class {'st2': version => '2.9.0' }" } + let(:facts) { os_facts.merge(st2_version: '2.9.0', 'st2::version' => '2.9.0') } + + it 'comparing with higher version (2.10.0) returns false' do + is_expected.to run.with_params('2.10.0').and_return(false) + end + + it 'comparing with lower version (2.8.0) returns true' do + is_expected.to run.with_params('2.8.0').and_return(true) + end + end + + context 'and st2_version = "2.9.0" st2::version = "2.10.0"' do + let(:pre_condition) { "class {'st2': version => '2.10.0' }" } + let(:facts) { os_facts.merge(st2_version: '2.9.0', 'st2::version' => '2.10.0') } + + it 'comparing with higher version (2.11.0) returns false' do + is_expected.to run.with_params('2.11.0').and_return(false) + end + + it 'comparing with lower version (2.8.0) returns true' do + is_expected.to run.with_params('2.8.0').and_return(true) + end + end + + context 'and st2_version = "2.10.0" st2::version = "2.9.0"' do + let(:pre_condition) { "class {'st2': version => '2.9.0' }" } + let(:facts) { os_facts.merge(st2_version: '2.10.0', 'st2::version' => '2.9.0') } + + it 'comparing with higher version (2.11.0) returns false' do + is_expected.to run.with_params('2.11.0').and_return(false) + end + + it 'comparing with lower version (2.8.0) returns true' do + is_expected.to run.with_params('2.8.0').and_return(true) + end + end end end end diff --git a/spec/helpers/fact_helper.rb b/spec/helpers/fact_helper.rb deleted file mode 100644 index ce4488cb..00000000 --- a/spec/helpers/fact_helper.rb +++ /dev/null @@ -1,132 +0,0 @@ -require 'json' - -module FactHelper - def self.ubuntu_trusty_x64 - facts = <<-EOF -{ - "kernelrelease": "3.13.0-36-generic", - "kernel": "Linux", - "mistral_bootstrapped": "true", - "role": "st2ops", - "st2client_bootstrapped": "true", - "st2server_bootstrapped": "true", - "st2web_bootstrapped": "true", - "virtual": "xenhvm", - "is_virtual": "true", - "ps": "ps -ef", - "uptime_hours": 123, - "interfaces": "eth0,lo", - "ipaddress_eth0": "10.0.1.41", - "macaddress_eth0": "06:cc:ca:50:17:98", - "netmask_eth0": "255.255.255.0", - "mtu_eth0": "9001", - "ipaddress_lo": "127.0.0.1", - "netmask_lo": "255.0.0.0", - "mtu_lo": "65536", - "operatingsystemrelease": "14.04", - "timezone": "UTC", - "lsbmajdistrelease": "14.04", - "id": "root", - "lsbdistid": "Ubuntu", - "kernelversion": "3.13.0", - "puppetversion": "3.7.3", - "processors": { - "models": [ - "Intel(R) Xeon(R) CPU E5-2666 v3 @ 2.90GHz", - "Intel(R) Xeon(R) CPU E5-2666 v3 @ 2.90GHz", - "Intel(R) Xeon(R) CPU E5-2666 v3 @ 2.90GHz", - "Intel(R) Xeon(R) CPU E5-2666 v3 @ 2.90GHz" - ], - "count": 4, - "physicalcount": 1 - }, - "architecture": "amd64", - "hardwaremodel": "x86_64", - "operatingsystem": "Ubuntu", - "os": { - "name": "Ubuntu", - "family": "Debian", - "release": { - "major": "14.04", - "full": "14.04" - }, - "lsb": { - "distcodename": "trusty", - "distid": "Ubuntu", - "distdescription": "Ubuntu 14.04.1 LTS", - "distrelease": "14.04", - "majdistrelease": "14.04" - } - }, - "processor0": "Intel(R) Xeon(R) CPU E5-2666 v3 @ 2.90GHz", - "processor1": "Intel(R) Xeon(R) CPU E5-2666 v3 @ 2.90GHz", - "processor2": "Intel(R) Xeon(R) CPU E5-2666 v3 @ 2.90GHz", - "processor3": "Intel(R) Xeon(R) CPU E5-2666 v3 @ 2.90GHz", - "processorcount": "4", - "fqdn": "st2ops001.uswest2.stackstorm.net", - "facterversion": "2.2.0", - "gid": "root", - "rubysitedir": "/usr/local/lib/site_ruby/1.9.1", - "rubyversion": "1.9.3", - "uptime_days": 5, - "lsbdistcodename": "trusty", - "uptime_seconds": 444736, - "hardwareisa": "x86_64", - "filesystems": "btrfs,ext2,ext3,ext4,hfs,hfsplus,iso9660,jfs,minix,msdos,ntfs,qnx4,ufs,vfat,xfs", - "path": "/opt/puppet/vendor/bundle/ruby/1.9.1/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", - "osfamily": "Debian", - "partitions": { - "xvda1": { - "uuid": "d36a9e2f-dae9-477f-8aea-29f1bdd1c04e", - "size": "16755795", - "mount": "/", - "filesystem": "ext4" - } - }, - "netmask": "255.255.255.0", - "ipaddress": "10.0.1.41", - "physicalprocessorcount": "1", - "uniqueid": "007f0100", - "operatingsystemmajrelease": "14.04", - "blockdevice_xvda_size": 8589934592, - "blockdevice_xvdf_size": 107374182400, - "blockdevice_xvdg_size": 107374182400, - "blockdevices": "xvda,xvdf,xvdg", - "domain": "uswest2.stackstorm.net", - "lsbdistdescription": "Ubuntu 14.04.1 LTS", - "system_uptime": { - "seconds": 444736, - "hours": 123, - "days": 5, - "uptime": "5 days" - }, - "uptime": "5 days", - "selinux": "false", - "augeasversion": "1.2.0", - "network_eth0": "10.0.1.0", - "network_lo": "127.0.0.0", - "memorysize": "7.30 GB", - "memoryfree": "5.27 GB", - "swapsize": "0.00 MB", - "swapfree": "0.00 MB", - "swapsize_mb": "0.00", - "swapfree_mb": "0.00", - "memorysize_mb": "7479.95", - "memoryfree_mb": "5400.86", - "bios_vendor": "Xen", - "bios_version": "4.2.amazon", - "bios_release_date": "05/06/2015", - "manufacturer": "Xen", - "productname": "HVM domU", - "serialnumber": "ec241919-264a-7b95-60e8-83d6d386eeaf", - "uuid": "EC241919-264A-7B95-60E8-83D6D386EEAF", - "type": "Other", - "lsbdistrelease": "14.04", - "macaddress": "06:cc:ca:50:17:98", - "hostname": "st2ops001", - "kernelmajversion": "3.13" -} -EOF - JSON.parse(facts) - end -end diff --git a/test/integration/stackstorm/inspec.yml b/test/integration/stackstorm/inspec.yml index df616d1c..45504851 100644 --- a/test/integration/stackstorm/inspec.yml +++ b/test/integration/stackstorm/inspec.yml @@ -1,9 +1,9 @@ name: stackstorm title: Integration Tests for StackStorm community summary: > - Tests to verify if StackStorm packages st2, st2web, st2mistral, st2chatops are installed, + Tests to verify if StackStorm packages st2, st2web, st2chatops are installed, files and directories are shipped, services are running as well as dependent servers like - nginx, postgresql, mongodb are available and working correctly. + nginx, mongodb are available and working correctly. maintainer: StackStorm copyright: StackStorm copyright_email: info@stackstorm.com