Recipe "DNA and genesis of a new SMW on any Ubuntu server"

From SMW CindyKate - Main
Component 998879
Jump to: navigation, search

Content


Local Setup

On your workstation set up the following structure based on the SMW Factory Components below.

[email protected]:~/workspace$ tree
.
├── ch.l-c-c.ansible-modules # Provided by provision_now.sh
├── standard-smw.playbook    # Provided manually
├── variables.yml            # Provided manually
├── inventory.file           # Provided manually
└── provision_now.sh         # Provided manually

SMW Factory Components

Ansible Role "lcc-standard-smw"


---

##############################################
# REGISTER CONFIGURATION DATA
- include: register_lcc_smw_class_profile.yml
- include: register_lcc_smw_instance_profile.yml

##############################################
# ADD STANDARD SMW USER
- name: Add standard user to OS
  user: name={{lcc_smw_standard_user}}

##############################################
# MEDIAWIKI CORE
- include: install_mediawiki_core.yml
  tags:
    - pending
- include: install_lcc_smw_settings.yml
  tags:
    - pending

- include: configure_apache.yml

##############################################
# MEDIAWIKI EXTENSIONS
- include: install_smw_extensions_by_composer.yml
  tags:
    - pending
- include: install_smw_extensions_from_archives.yml
  tags:
    - pending

- include: initialize_smw.yml
  tags:
    - pending

- include: install_nodejs_libraries.yml
  tags:
    - pending

##############################################
# MORE
- include: install_system_web_interface.yml

referred by

variables.yml

  • This file specifies where the Ansible Role can find
    1. FTP resources and
    2. profiles (as specified in the inventory file).
  • This file must be created locally.

---
lcc_resources_ftp:
  server: "ftp://46.101.193.129"
lcc_resources_smw:
  server: "192.168.37.230"
  path: "/w/"
  username: "roapi"
  password: "27i34w22f"

referred by

SMW Profiles


---
WEB-SERVER:
  document_root               : /var/www/html/m
SMW-INSTALLATION:
  Wiki_name                   : "Standard SMW"
  logo                        : smw_logo.png
  wgScriptPath                : m
  ArticlePath                 : main
  version                     : mediawiki-1.26.2.tar.gz
  smw_category_label          : Category
  lcc_smw_mysql_db_and_os_user: smwmain
  lcc_smw_mysql_db_name       : smwmain
SMW-COMPOSER-JSON:
  require:
    mediawiki/semantic-media-wiki : 2.3.1
    mediawiki/semantic-forms: 3.4.1
    mediawiki/semantic-forms-select: 1.3
    mediawiki/side-bar-menu: dev-REL1_26
    mediawiki/image-map: dev-REL1_26
    mediawiki/semantic-maps: 3.2.0
    mediawiki/graph-viz: 1.2.0
    mediawiki/semantic-result-formats: 2.3
    tecnick.com/tcpdf: 6.2.6
    symfony/yaml: 3.0.*@dev
  config:
    github-oauth:
      github.com: fe0ecadb8fe8da56611a6d54cf96d5b5bb590790
SMW-EXTENSIONS:
  SemanticFormsInputs:
    archive: SemanticFormsInputs-REL1_26-513008c.tar.gz
    require: require_once("$IP/extensions/SemanticFormsInputs/SemanticFormsInputs.php");
  MyVariables:
    archive: MyVariables-REL1_26-07c8941.tar.gz
    require: require_once("$IP/extensions/MyVariables/MyVariables.php");
  HeaderTabs:
    archive: HeaderTabs-REL1_26-440dd93.tar.gz
    require: require_once("$IP/extensions/HeaderTabs/HeaderTabs.php");
  CategoryTree:
    archive: CategoryTree-REL1_26-8d91b0a.tar.gz
    require: $wgUseAjax = true; require_once("$IP/extensions/CategoryTree/CategoryTree.php");
  ExternalData:
    archive: ExternalData-1.8.tar.gz
    require: require_once("$IP/extensions/ExternalData/ExternalData.php");
  Widgets:
    archive: Widgets-REL1_26-98ad8e3.tar.gz
    require: require_once("$IP/extensions/Widgets/Widgets.php");
  MagicNoCache:
    archive: MagicNoCache.tar.gz
    require: require_once("$IP/extensions/MagicNoCache/MagicNoCache.php");
  SemanticCompoundQueries:
    archive: SemanticCompoundQueries_0.4.tar.gz
    require: require_once("$IP/extensions/SemanticCompoundQueries/SemanticCompoundQueries.php");
  Scribunto:
    archive: Scribunto-REL1_26-4d4766f.tar.gz
    require: require_once "$IP/extensions/Scribunto/Scribunto.php";
  Variables:
    archive: Variables-REL1_26-510f243.tar.gz
    require: require_once "$IP/extensions/Variables/Variables.php";
  ReplaceText:
    archive: ReplaceText-REL1_26-8881240.tar.gz
    require: require_once( "$IP/extensions/ReplaceText/ReplaceText.php" );
  SemanticFormsSelect:
    archive: SemanticFormsSelect_1.1.tar.gz
    require: require_once("$IP/extensions/SemanticFormsSelect/SemanticFormsSelect.php");
  UrlGetParameters:
    archive: UrlGetParameters-REL1_26-bd37808.tar.gz
    require: require_once("$IP/extensions/UrlGetParameters/UrlGetParameters.php");
  CategoryMembersOnSidebar:
    archive: CategoryMembersOnSidebar.tar.gz
    require: require_once("$IP/extensions/CategoryMembersOnSidebar/CategoryMembersOnSidebar.php");
  ParserFunctions:
    archive: ParserFunctions-REL1_26-81eca7c.tar.gz
    require: require_once "$IP/extensions/ParserFunctions/ParserFunctions.php";
  ReplaceSet:
    archive: ReplaceSet-REL1_26-d110924.tar.gz
    require: require_once "$IP/extensions/ReplaceSet/ReplaceSet.php";
  AutoCreatePage:
    archive: AutoCreatePage.tar.gz
    require: require_once "$IP/extensions/AutoCreatePage/AutoCreatePage.php";
  SemanticTitle:
    archive: SemanticTitle-REL1_26-c407921.tar.gz
    require: require_once "$IP/extensions/SemanticTitle/SemanticTitle.php";
  Cargo:
    archive: Cargo-REL1_26-59288fe.tar.gz
    require: require_once("$IP/extensions/Cargo/Cargo.php");
  RegexFun:
    archive: RegexFun-REL1_26-0be7ba9.tar.gz
    require: require_once "$IP/extensions/RegexFun/RegexFun.php";
  Arrays:
    archive: Arrays-REL1_26-735b832.tar.gz
    require: require_once "$IP/extensions/Arrays/Arrays.php";
LOCALSETTINGS:
  - $wgGroupPermissions["*"]["writeapi"] = false;
  - $wgGroupPermissions["bot"]["writeapi"] = false;
  - $wgGroupPermissions["user"]["writeapi"] = false;
  - $wgGroupPermissions["sysop"]["writeapi"] = true;
  - $wgGroupPermissions['sysop']['upload_by_url'] = true;
  - $wgEnableUploads = true;
  - $wgUseImageMagick = true;
  - $wgImageMagickConvertCommand = "/usr/bin/convert";
  - $wgSVGConverter = "ImageMagick";
  - $wgFileExtensions[] = "svg";
  - $sfgAutocompleteOnAllChars = true;
  - $sfgMaxLocalAutocompleteValues = 1;
  - $wgEnableParserCache = false;
  - $wgCachePages = false;
  - $sfgRenameEditTabs = true;
  - $htEditTabLink = false;
  - $wgMaxImageArea = 80000000;
  - $wgPFEnableStringFunctions = true;
  - $smwgLinksInValues = true;
  - $smwgEnabledEditPageHelp = false;
  - $wgPFEnableStringFunctions = true;
  - $wgAllowCopyUploads=true;
  - $htGenerateTabTocs=true;
  - $wgSemanticTitleProperties = array(NS_MAIN => "Has semantic display title");

referred by

Ansible Modules



referred by

Ansible Playbook "standard-smw.playbook"

  • This file must be created locally.

---
- hosts: all
  sudo: True
  gather_facts: False
  vars_files:
    - variables.yml
  roles:
    - /home/lex/Software/lcc-standard-smw

referred by

Ansible Inventory File "inventory.file"


[Servers]
smw-cindykate.ch_STAGE

[Servers:vars]
ansible_ssh_host=127.0.0.1
ansible_ssh_port=20070
ansible_ssh_user=lccsmw
lcc_smw_class_profile=SMW Class Profile "Standard SMW"
lcc_smw_instance_profile=SMW Instance Profile "Standard SMW"
lcc_smw_meta_resources=lcc_smw_meta_resources.yml
lcc_smw_hostname=smw-cindykate.ch
lcc_smw_standard_user=lccsmw

referred by

"provision_now.sh" is the shell script you run in order to deploy a new SMW on any Ubuntu Server

  • This file must be created locally.

#!/bin/sh

# Set these variables
WORKSPACE=

###################################
### DO NOT EDIT BELOW THIS LINE ###
###################################

# Get LCC Ansible Modules
#git clone https://github.com/LinuxCompetenceCenter/ch.l-c-c.ansible-modules.git ${WORKSPACE}ch.l-c-c.ansible-modules

# Install Ansible Roles (PENDING)
#ansible-galaxy install LinuxCompetenceCenterGalaxy.lcc-standard-smw

# Run Ansible Playbook
ansible-playbook \
    --module-path=${WORKSPACE}ch.l-c-c.ansible-modules \
    --inventory-file=inventory.file \
    --ask-pass \
    --ask-sudo-pass \
      playbook.yml

creating
Smw factory component logo ubuntu.png Ubuntu Server