{"host": "deployment-deploy04.deployment-prep.eqiad1.wikimedia.cloud", "state": "core_diff", "description": "Differences to core resources", "diff": {"full": {"total": 2360, "only_in_self": [], "only_in_other": ["Exec[systemd daemon-reload for beta-autoupdater-prune-stale-logs.service (beta-autoupdater-prune-stale-logs.service)]", "Exec[systemd daemon-reload for beta-autoupdater-prune-stale-logs.timer (beta-autoupdater-prune-stale-logs.timer)]", "Exec[systemd daemon-reload for wmf-beta-update-all.service (wmf-beta-update-all.service)]", "Exec[systemd daemon-reload for wmf-beta-update-all.timer (wmf-beta-update-all.timer)]", "File[/etc/apache2/sites-available/50-beta-autoupdater.conf]", "File[/etc/apache2/sites-enabled/50-beta-autoupdater.conf]", "File[/etc/logrotate.d/beta-autoupdater-prune-stale-logs]", "File[/etc/logrotate.d/wmf-beta-update-all]", "File[/etc/rsyslog.d/40-beta-autoupdater-prune-stale-logs.conf]", "File[/etc/rsyslog.d/40-wmf-beta-update-all.conf]", "File[/lib/systemd/system/beta-autoupdater-prune-stale-logs.service]", "File[/lib/systemd/system/beta-autoupdater-prune-stale-logs.timer]", "File[/lib/systemd/system/wmf-beta-update-all.service]", "File[/lib/systemd/system/wmf-beta-update-all.timer]", "File[/srv/beta-update-logs]", "File[/usr/local/bin/wmf-beta-update-all]", "File[/var/log/beta-autoupdater-prune-stale-logs]", "File[/var/log/wmf-beta-update-all]", "Httpd::Conf[beta-autoupdater]", "Httpd::Site[beta-autoupdater]", "Logrotate::Conf[beta-autoupdater-prune-stale-logs]", "Logrotate::Conf[wmf-beta-update-all]", "Rsyslog::Conf[beta-autoupdater-prune-stale-logs]", "Rsyslog::Conf[wmf-beta-update-all]", "Service[beta-autoupdater-prune-stale-logs.timer]", "Service[wmf-beta-update-all.timer]", "Systemd::Service[beta-autoupdater-prune-stale-logs]", "Systemd::Service[wmf-beta-update-all]", "Systemd::Syslog[beta-autoupdater-prune-stale-logs]", "Systemd::Syslog[wmf-beta-update-all]", "Systemd::Timer::Job[beta-autoupdater-prune-stale-logs]", "Systemd::Timer::Job[wmf-beta-update-all]", "Systemd::Timer[beta-autoupdater-prune-stale-logs]", "Systemd::Timer[wmf-beta-update-all]", "Systemd::Unit[beta-autoupdater-prune-stale-logs.service]", "Systemd::Unit[beta-autoupdater-prune-stale-logs.timer]", "Systemd::Unit[wmf-beta-update-all.service]", "Systemd::Unit[wmf-beta-update-all.timer]"], "resource_diffs": [{"resource": "File[/etc/apache2/sites-enabled/50-beta-autoupdater.conf]", "parameters": "--- File[/etc/apache2/sites-enabled/50-beta-autoupdater.conf].orig\n+++ File[/etc/apache2/sites-enabled/50-beta-autoupdater.conf]\n\n+    ensure => link\n+    target => /etc/apache2/sites-available/50-beta-autoupdater.conf\n+    owner  => root\n+    notify => Service[apache2]\n+    group  => root\n"}, {"resource": "File[/lib/systemd/system/beta-autoupdater-prune-stale-logs.service]", "content": "--- /lib/systemd/system/beta-autoupdater-prune-stale-logs.service.orig\n+++ /lib/systemd/system/beta-autoupdater-prune-stale-logs.service\n@@ -0,0 +1,8 @@\n+[Unit]\n+Description=Prune stale autoupdater logs\n+Documentation=https://wikitech.wikimedia.org/wiki/Monitoring/systemd_unit_state\n+\n+[Service]\n+Type=oneshot\n+User=jenkins-deploy\n+ExecStart=/usr/bin/find /srv/beta-update-logs -type f -mtime +3 -delete", "parameters": "--- File[/lib/systemd/system/beta-autoupdater-prune-stale-logs.service].orig\n+++ File[/lib/systemd/system/beta-autoupdater-prune-stale-logs.service]\n\n+    ensure => present\n+    mode   => 0444\n+    owner  => root\n+    notify => Exec[systemd daemon-reload for beta-autoupdater-prune-stale-logs.service (beta-autoupdater-prune-stale-logs.service)]\n+    group  => root\n"}, {"resource": "Class[Profile::Beta::Autoupdater]", "parameters": "--- Class[Profile::Beta::Autoupdater].orig\n+++ Class[Profile::Beta::Autoupdater]\n\n+    update_interval => *:0/10\n+    run_updater     => True\n+    apache_fqdn     => beta-update.wmcloud.org\n"}, {"resource": "Httpd::Site[beta-autoupdater]", "parameters": "--- Httpd::Site[beta-autoupdater].orig\n+++ Httpd::Site[beta-autoupdater]\n\n+    require  => File[/srv/beta-update-logs]\n+    ensure   => present\n+    priority => 50\n"}, {"resource": "File[/lib/systemd/system/wmf-beta-update-all.service]", "content": "--- /lib/systemd/system/wmf-beta-update-all.service.orig\n+++ /lib/systemd/system/wmf-beta-update-all.service\n@@ -0,0 +1,9 @@\n+[Unit]\n+Description=Update MediaWiki code, config, and databases\n+Documentation=https://wikitech.wikimedia.org/wiki/Monitoring/systemd_unit_state\n+\n+[Service]\n+Type=oneshot\n+User=jenkins-deploy\n+SyslogIdentifier=wmf-beta-update-all\n+ExecStart=/usr/local/bin/systemd-timer-mail-wrapper --subject wmf-beta-update-all --mail-to releng@lists.wikimedia.org --mail-from noreply@deployment-deploy04.deployment-prep.eqiad1.wikimedia.cloud --only-on-error /usr/local/bin/wmf-beta-update-all", "parameters": "--- File[/lib/systemd/system/wmf-beta-update-all.service].orig\n+++ File[/lib/systemd/system/wmf-beta-update-all.service]\n\n+    ensure => present\n+    mode   => 0444\n+    owner  => root\n+    notify => Exec[systemd daemon-reload for wmf-beta-update-all.service (wmf-beta-update-all.service)]\n+    group  => root\n"}, {"resource": "Exec[systemd daemon-reload for wmf-beta-update-all.service (wmf-beta-update-all.service)]", "parameters": "--- Exec[systemd daemon-reload for wmf-beta-update-all.service (wmf-beta-update-all.service)].orig\n+++ Exec[systemd daemon-reload for wmf-beta-update-all.service (wmf-beta-update-all.service)]\n\n+    command     => /bin/systemctl daemon-reload\n+    refreshonly => True\n"}, {"resource": "Rsyslog::Conf[beta-autoupdater-prune-stale-logs]", "parameters": "--- Rsyslog::Conf[beta-autoupdater-prune-stale-logs].orig\n+++ Rsyslog::Conf[beta-autoupdater-prune-stale-logs]\n\n+    ensure   => present\n+    priority => 40\n+    require  => File[/var/log/beta-autoupdater-prune-stale-logs]\n+    mode     => 0444\n"}, {"resource": "File[/var/log/wmf-beta-update-all]", "parameters": "--- File[/var/log/wmf-beta-update-all].orig\n+++ File[/var/log/wmf-beta-update-all]\n\n+    ensure => directory\n+    mode   => 0755\n+    owner  => jenkins-deploy\n+    force  => True\n+    backup => False\n+    group  => root\n"}, {"resource": "Systemd::Syslog[beta-autoupdater-prune-stale-logs]", "parameters": "--- Systemd::Syslog[beta-autoupdater-prune-stale-logs].orig\n+++ Systemd::Syslog[beta-autoupdater-prune-stale-logs]\n\n+    force_stop             => True\n+    ensure                 => present\n+    base_dir               => /var/log\n+    programname_comparison => startswith\n+    log_filename           => syslog.log\n+    owner                  => jenkins-deploy\n+    readable_by            => all\n+    group                  => root\n"}, {"resource": "Exec[systemd daemon-reload for beta-autoupdater-prune-stale-logs.timer (beta-autoupdater-prune-stale-logs.timer)]", "parameters": "--- Exec[systemd daemon-reload for beta-autoupdater-prune-stale-logs.timer (beta-autoupdater-prune-stale-logs.timer)].orig\n+++ Exec[systemd daemon-reload for beta-autoupdater-prune-stale-logs.timer (beta-autoupdater-prune-stale-logs.timer)]\n\n+    command     => /bin/systemctl daemon-reload\n+    refreshonly => True\n+    before      => ['Service[beta-autoupdater-prune-stale-logs.timer]']\n"}, {"resource": "File[/usr/local/bin/wmf-beta-update-all]", "content": "--- /usr/local/bin/wmf-beta-update-all.orig\n+++ /usr/local/bin/wmf-beta-update-all\n@@ -0,0 +1,42 @@\n+#!/usr/bin/env bash\n+#\n+# Update the MediaWiki deployments and databases powering the Beta Cluster\n+#\n+# SPDX-License-Identifier: Apache-2.0\n+#######################################################################\n+# WARNING: this file is managed by Puppet\n+# puppet:///modules/beta/templates/wmf-beta-update-all.sh.erb\n+#######################################################################\n+set -euxo pipefail\n+\n+RUN_ID=${1:-$(date +%Y%m%d%H%M)}\n+LOG_DIR=/srv/beta-update-logs\n+\n+# Log everything output by this script\n+# - `ts` adds a timestamp to each line\n+# - `tee` duplicates the output to the shell\n+exec &> >(ts '[%H:%M:%S]' | tee -a \"${LOG_DIR}/${RUN_ID}.log\")\n+\n+# T204762: scap/sh blindly closes all potentially available file\n+# descriptors. With one million of them, that slows down each command\n+# execution by 240 ms.\n+ulimit -n 512\n+\n+# Clear a stale lock file if it exists\n+# FIXME: Needed? This is cargo cult from beta-scap-sync-world Jenkins.\n+LOCKFILE=\"/var/lock/scap.operations_mediawiki-config.lock\"\n+if [ -O \"$LOCKFILE\" ]; then\n+  rm \"$LOCKFILE\"\n+fi\n+\n+# Log the version of scap that is currently deployed.\n+/usr/bin/scap version\n+\n+# Update git clones\n+/usr/bin/scap prep auto\n+\n+# Push the current code and config out to the MediaWiki fleet\n+/usr/bin/scap sync-world \"wmf-beta-update-all run\"\n+\n+# Update databases to match the current code and config\n+/usr/local/bin/wmf-beta-update-databases.py", "parameters": "--- File[/usr/local/bin/wmf-beta-update-all].orig\n+++ File[/usr/local/bin/wmf-beta-update-all]\n\n+    owner => root\n+    mode  => 0555\n+    group => root\n"}, {"resource": "Systemd::Unit[beta-autoupdater-prune-stale-logs.timer]", "parameters": "--- Systemd::Unit[beta-autoupdater-prune-stale-logs.timer].orig\n+++ Systemd::Unit[beta-autoupdater-prune-stale-logs.timer]\n\n+    ensure            => present\n+    restart           => False\n+    override          => False\n+    unit              => beta-autoupdater-prune-stale-logs.timer\n+    override_filename => puppet-override.conf\n+    require           => ['Class[Systemd]']\n"}, {"resource": "Systemd::Unit[beta-autoupdater-prune-stale-logs.service]", "parameters": "--- Systemd::Unit[beta-autoupdater-prune-stale-logs.service].orig\n+++ Systemd::Unit[beta-autoupdater-prune-stale-logs.service]\n\n+    ensure            => present\n+    restart           => False\n+    override          => False\n+    unit              => beta-autoupdater-prune-stale-logs.service\n+    override_filename => puppet-override.conf\n+    require           => ['Class[Systemd]']\n"}, {"resource": "Httpd::Conf[beta-autoupdater]", "parameters": "--- Httpd::Conf[beta-autoupdater].orig\n+++ Httpd::Conf[beta-autoupdater]\n\n+    ensure    => present\n+    conf_type => sites\n+    priority  => 50\n"}, {"resource": "Systemd::Unit[wmf-beta-update-all.timer]", "parameters": "--- Systemd::Unit[wmf-beta-update-all.timer].orig\n+++ Systemd::Unit[wmf-beta-update-all.timer]\n\n+    ensure            => present\n+    restart           => False\n+    override          => False\n+    unit              => wmf-beta-update-all.timer\n+    override_filename => puppet-override.conf\n+    require           => ['Class[Systemd]']\n"}, {"resource": "Systemd::Timer[wmf-beta-update-all]", "parameters": "--- Systemd::Timer[wmf-beta-update-all].orig\n+++ Systemd::Timer[wmf-beta-update-all]\n\n+    unit_name          => wmf-beta-update-all.service\n+    ensure             => present\n+    timer_intervals    => [{'start': 'OnCalendar', 'interval': '*:0/10'}]\n+    accuracy           => 15sec\n+    fixed_random_delay => False\n+    splay              => 0\n"}, {"resource": "Systemd::Service[wmf-beta-update-all]", "parameters": "--- Systemd::Service[wmf-beta-update-all].orig\n+++ Systemd::Service[wmf-beta-update-all]\n\n+    ensure                   => present\n+    restart                  => False\n+    service_params           => {}\n+    require                  => Systemd::Unit[wmf-beta-update-all.service]\n+    unit_type                => timer\n+    monitoring_contact_group => admins\n+    monitoring_enabled       => False\n+    migration_task           => T407130\n+    override                 => False\n+    monitoring_critical      => False\n"}, {"resource": "File[/usr/local/bin/wmf-beta-autoupdate.py]", "content": "--- /usr/local/bin/wmf-beta-autoupdate.py.orig\n+++ /usr/local/bin/wmf-beta-autoupdate.py\n@@ -1,148 +0,0 @@\n-#!/usr/bin/env python\n-#######################################################################\n-# WARNING: this file is managed by Puppet\n-# puppet:///beta/wmf-beta-autoupdate.py.erb\n-#######################################################################\n-\n-\"\"\"\n-Updates MediaWiki core and extensions on the Beta cluster\n-\n-MUST be run as the `mwdeploy` user although that is not enforced by the script.\n-\"\"\"\n-\n-import argparse\n-import logging\n-import subprocess\n-import sys\n-\n-PATH_PORTAL = '/srv/mediawiki-staging/portal-master'\n-PATH_MWCORE = '/srv/mediawiki-staging/php-master'\n-PATH_MWEXT = '/srv/mediawiki-staging/php-master/extensions'\n-PATH_MWSKIN = '/srv/mediawiki-staging/php-master/skins'\n-PATH_VENDOR = '/srv/mediawiki-staging/php-master/vendor'\n-\n-\n-def main():\n-    \"\"\"\n-    Entry point for the script.\n-\n-    Parse script arguments, initialize the logger withnice colors and trigger\n-    the updating tasks.\n-\n-    Returns 0 on success of ALL tasks, 1 otherwise\n-    \"\"\"\n-    # Parse arguments, init logger to use some colors\n-\n-    options = parse_args()\n-    logging.basicConfig(level=options.log_level)\n-    # Color codes http://www.tldp.org/HOWTO/Bash-Prompt-HOWTO/x329.html\n-    logging.addLevelName(  # cyan\n-        logging.DEBUG, \"\\033[36m%s\\033[0m\" %\n-        logging.getLevelName(logging.DEBUG))\n-    logging.addLevelName(  # green\n-        logging.INFO, \"\\033[32m%s\\033[0m\" %\n-        logging.getLevelName(logging.INFO))\n-    logging.addLevelName(  # yellow\n-        logging.WARNING, \"\\033[33m%s\\033[0m\" %\n-        logging.getLevelName(logging.WARNING))\n-    logging.addLevelName(  # red\n-        logging.ERROR, \"\\033[31m%s\\033[0m\" %\n-        logging.getLevelName(logging.ERROR))\n-    logging.addLevelName(  # red background\n-        logging.CRITICAL, \"\\033[41m%s\\033[0m\" %\n-        logging.getLevelName(logging.CRITICAL))\n-\n-    logger = logging.getLogger('main')\n-\n-    logger.info(\"Starting updating tasks...\")\n-    # TODO refactor to use a dict with 'name' as keys and function value\n-    exit_codes = [\n-        pull_repo(name='mwcore', path=PATH_MWCORE),\n-        pull_repo(name='mwvendor', path=PATH_VENDOR),\n-        pull_repo(name='mwextpull', path=PATH_MWEXT),\n-        submodule_sync(name='mwextpull', path=PATH_MWEXT),\n-        update_repo(name='mwextupdate', path=PATH_MWEXT),\n-        pull_repo(name='mwskinpull', path=PATH_MWSKIN),\n-        submodule_sync(name='mwskinupdate', path=PATH_MWSKIN),\n-        update_repo(name='mwskinupdate', path=PATH_MWSKIN),\n-        pull_repo(name='portal', path=PATH_PORTAL),\n-    ]\n-\n-    logger.info(\"Executions completed %s\", exit_codes)\n-\n-    final_exit = 0\n-    for code in exit_codes:\n-        if code is not 0:\n-            final_exit = 1\n-            break\n-\n-    logger.info(\"Final exit code: %s\", final_exit)\n-    return final_exit\n-\n-\n-def parse_args():\n-    \"\"\"Parse command line arguments using argparse\"\"\"\n-\n-    parser = argparse.ArgumentParser(description=__doc__)\n-\n-    log_options = parser.add_mutually_exclusive_group()\n-    log_options.add_argument(\n-        '--debug', dest='log_level',\n-        action='store_const', const=logging.DEBUG,\n-        help='Print out internal processing')\n-    log_options.add_argument(\n-        '-v', '--verbose', '--info', dest='log_level',\n-        action='store_const', const=logging.INFO,\n-        help='Give a bit more information about what is going on')\n-    log_options.add_argument(\n-        '-q', '--quiet', dest='log_level',\n-        action='store_const', const=logging.WARNING,\n-        help='Only shows up warning and errors')\n-\n-    return parser.parse_args()\n-\n-\n-def git_head_ts(git_dir):\n-    \"\"\"Returns timestamp of the HEAD committer date\"\"\"\n-    proc = subprocess.check_output(\n-        ['git', '--git-dir', git_dir, 'log',\n-         '--pretty=tformat:%ct', '-1', 'HEAD'])\n-    return proc.rstrip('\\n')\n-\n-\n-def pull_repo(name, path):\n-    \"\"\"Pull repository at path\"\"\"\n-    return runner(name=name, path=path, cmd=['git', 'pull'])\n-\n-def submodule_sync(name, path):\n-    \"\"\"Syncs the submodules in path\"\"\"\n-    return runner(name=name, path=path, cmd=[\n-        'git', 'submodule', 'sync', '--recursive'])\n-\n-def update_repo(name, path):\n-    \"\"\"Registers and updates submodules in path\"\"\"\n-    return runner(name=name, path=path, cmd=[\n-        'git', 'submodule', 'update', '--init', '--recursive'])\n-\n-\n-def runner(cmd, path=None, name=None):\n-    \"\"\"Wrapper around subprocess.Popen with logging output\"\"\"\n-    log_target = name if name else 'runner'\n-    logger = logging.getLogger(log_target)\n-\n-    try:\n-        if path:\n-            logger.info(\"cwd: %s\", path)\n-        logger.info(\"running: %s\", ' '.join(cmd))\n-\n-        cmd = subprocess.Popen(args=cmd, cwd=path)\n-        exit_code = cmd.wait()\n-        logger.info(\"Exit code: %s\", exit_code)\n-    except OSError, exception:\n-        logger.error(exception)\n-        return False\n-\n-    return exit_code\n-\n-if __name__ == '__main__':\n-    sys.exit(main())", "parameters": "--- File[/usr/local/bin/wmf-beta-autoupdate.py].orig\n+++ File[/usr/local/bin/wmf-beta-autoupdate.py]\n\n-    require => Package[git]\n-    mode    => 0555\n+    ensure  => absent\n"}, {"resource": "Systemd::Unit[wmf-beta-update-all.service]", "parameters": "--- Systemd::Unit[wmf-beta-update-all.service].orig\n+++ Systemd::Unit[wmf-beta-update-all.service]\n\n+    ensure            => present\n+    restart           => False\n+    override          => False\n+    unit              => wmf-beta-update-all.service\n+    override_filename => puppet-override.conf\n+    require           => ['Class[Systemd]']\n"}, {"resource": "File[/var/log/beta-autoupdater-prune-stale-logs]", "parameters": "--- File[/var/log/beta-autoupdater-prune-stale-logs].orig\n+++ File[/var/log/beta-autoupdater-prune-stale-logs]\n\n+    ensure => directory\n+    mode   => 0755\n+    owner  => jenkins-deploy\n+    force  => True\n+    backup => False\n+    group  => root\n"}, {"resource": "Rsyslog::Conf[wmf-beta-update-all]", "parameters": "--- Rsyslog::Conf[wmf-beta-update-all].orig\n+++ Rsyslog::Conf[wmf-beta-update-all]\n\n+    ensure   => present\n+    priority => 40\n+    require  => File[/var/log/wmf-beta-update-all]\n+    mode     => 0444\n"}, {"resource": "File[/etc/apache2/sites-available/50-beta-autoupdater.conf]", "content": "--- /etc/apache2/sites-available/50-beta-autoupdater.conf.orig\n+++ /etc/apache2/sites-available/50-beta-autoupdater.conf\n@@ -0,0 +1,21 @@\n+# SPDX-License-Identifier: Apache-2.0\n+\n+<VirtualHost *:80>\n+    ServerName beta-update.wmcloud.org\n+    ServerAdmin noc@wikimedia.org\n+    DocumentRoot /srv/beta-update-logs\n+    <Directory /srv/beta-update-logs>\n+        Options Indexes FollowSymLinks MultiViews\n+        AddType text/plain .log\n+        AddCharset utf-8 .log\n+\n+        AllowOverride None\n+        Require all granted\n+    </Directory>\n+\n+    LogLevel warn\n+    ErrorLog /var/log/apache2/beta-update.wmcloud.org_error.log\n+    CustomLog /var/log/apache2/beta-update.wmcloud.org_access.log wmf\n+    ServerSignature Off\n+</VirtualHost>\n+", "parameters": "--- File[/etc/apache2/sites-available/50-beta-autoupdater.conf].orig\n+++ File[/etc/apache2/sites-available/50-beta-autoupdater.conf]\n\n+    ensure => present\n+    mode   => 0444\n+    owner  => root\n+    notify => Service[apache2]\n+    group  => root\n"}, {"resource": "Systemd::Service[beta-autoupdater-prune-stale-logs]", "parameters": "--- Systemd::Service[beta-autoupdater-prune-stale-logs].orig\n+++ Systemd::Service[beta-autoupdater-prune-stale-logs]\n\n+    ensure                   => present\n+    restart                  => False\n+    service_params           => {}\n+    require                  => Systemd::Unit[beta-autoupdater-prune-stale-logs.service]\n+    unit_type                => timer\n+    monitoring_contact_group => admins\n+    monitoring_enabled       => False\n+    migration_task           => T407130\n+    override                 => False\n+    monitoring_critical      => False\n"}, {"resource": "File[/etc/rsyslog.d/40-wmf-beta-update-all.conf]", "content": "--- /etc/rsyslog.d/40-wmf-beta-update-all.conf.orig\n+++ /etc/rsyslog.d/40-wmf-beta-update-all.conf\n@@ -0,0 +1,10 @@\n+# rsyslog.conf(5) configuration file for services.\n+# This file is managed by Puppet.\n+if $programname startswith \"wmf-beta-update-all\" then {\n+    action(\n+        type=\"omfile\" file=\"/var/log/wmf-beta-update-all/syslog.log\"\n+        fileOwner=\"jenkins-deploy\" fileGroup=\"root\"\n+        fileCreateMode=\"0644\"\n+    )\n+    & stop\n+}", "parameters": "--- File[/etc/rsyslog.d/40-wmf-beta-update-all.conf].orig\n+++ File[/etc/rsyslog.d/40-wmf-beta-update-all.conf]\n\n+    ensure => present\n+    mode   => 0444\n+    owner  => root\n+    notify => Service[rsyslog]\n+    group  => root\n"}, {"resource": "File[/srv/beta-update-logs]", "parameters": "--- File[/srv/beta-update-logs].orig\n+++ File[/srv/beta-update-logs]\n\n+    ensure => directory\n+    owner  => jenkins-deploy\n+    mode   => 0655\n+    group  => root\n"}, {"resource": "Exec[systemd daemon-reload for wmf-beta-update-all.timer (wmf-beta-update-all.timer)]", "parameters": "--- Exec[systemd daemon-reload for wmf-beta-update-all.timer (wmf-beta-update-all.timer)].orig\n+++ Exec[systemd daemon-reload for wmf-beta-update-all.timer (wmf-beta-update-all.timer)]\n\n+    command     => /bin/systemctl daemon-reload\n+    refreshonly => True\n+    before      => ['Service[wmf-beta-update-all.timer]']\n"}, {"resource": "Service[beta-autoupdater-prune-stale-logs.timer]", "parameters": "--- Service[beta-autoupdater-prune-stale-logs.timer].orig\n+++ Service[beta-autoupdater-prune-stale-logs.timer]\n\n+    ensure   => running\n+    enable   => True\n+    provider => systemd\n"}, {"resource": "File[/etc/logrotate.d/beta-autoupdater-prune-stale-logs]", "content": "--- /etc/logrotate.d/beta-autoupdater-prune-stale-logs.orig\n+++ /etc/logrotate.d/beta-autoupdater-prune-stale-logs\n@@ -0,0 +1,12 @@\n+# logrotate(8) config for beta-autoupdater-prune-stale-logs\n+\n+/var/log/beta-autoupdater-prune-stale-logs/*.log {\n+    daily\n+    copytruncate\n+    missingok\n+    compress\n+    delaycompress\n+    notifempty\n+    rotate 15\n+    size 256M\n+}", "parameters": "--- File[/etc/logrotate.d/beta-autoupdater-prune-stale-logs].orig\n+++ File[/etc/logrotate.d/beta-autoupdater-prune-stale-logs]\n\n+    ensure => present\n+    owner  => root\n+    mode   => 0444\n+    group  => root\n"}, {"resource": "Systemd::Timer::Job[beta-autoupdater-prune-stale-logs]", "parameters": "--- Systemd::Timer::Job[beta-autoupdater-prune-stale-logs].orig\n+++ Systemd::Timer::Job[beta-autoupdater-prune-stale-logs]\n\n+    command                   => /usr/bin/find /srv/beta-update-logs -type f -mtime +3 -delete\n+    send_mail_only_on_error   => True\n+    success_exit_status       => []\n+    send_mail_to              => root@deployment-deploy04.deployment-prep.eqiad1.wikimedia.cloud\n+    fixed_random_delay        => False\n+    interval                  => {'start': 'OnCalendar', 'interval': 'daily'}\n+    logging_enabled           => True\n+    ignore_errors             => False\n+    monitoring_enabled        => False\n+    logfile_group             => root\n+    environment               => {}\n+    syslog_force_stop         => True\n+    ensure                    => present\n+    description               => Prune stale autoupdater logs\n+    user                      => jenkins-deploy\n+    logfile_basedir           => /var/log\n+    syslog_match_startswith   => True\n+    private_tmp               => False\n+    require                   => File[/srv/beta-update-logs]\n+    logfile_perms             => all\n+    monitoring_notes_url      => https://wikitech.wikimedia.org/wiki/Monitoring/systemd_unit_state\n+    logfile_name              => syslog.log\n+    send_mail                 => False\n+    monitoring_contact_groups => admins\n"}, {"resource": "File[/etc/rsyslog.d/40-beta-autoupdater-prune-stale-logs.conf]", "content": "--- /etc/rsyslog.d/40-beta-autoupdater-prune-stale-logs.conf.orig\n+++ /etc/rsyslog.d/40-beta-autoupdater-prune-stale-logs.conf\n@@ -0,0 +1,10 @@\n+# rsyslog.conf(5) configuration file for services.\n+# This file is managed by Puppet.\n+if $programname startswith \"beta-autoupdater-prune-stale-logs\" then {\n+    action(\n+        type=\"omfile\" file=\"/var/log/beta-autoupdater-prune-stale-logs/syslog.log\"\n+        fileOwner=\"jenkins-deploy\" fileGroup=\"root\"\n+        fileCreateMode=\"0644\"\n+    )\n+    & stop\n+}", "parameters": "--- File[/etc/rsyslog.d/40-beta-autoupdater-prune-stale-logs.conf].orig\n+++ File[/etc/rsyslog.d/40-beta-autoupdater-prune-stale-logs.conf]\n\n+    ensure => present\n+    mode   => 0444\n+    owner  => root\n+    notify => Service[rsyslog]\n+    group  => root\n"}, {"resource": "File[/lib/systemd/system/wmf-beta-update-all.timer]", "content": "--- /lib/systemd/system/wmf-beta-update-all.timer.orig\n+++ /lib/systemd/system/wmf-beta-update-all.timer\n@@ -0,0 +1,12 @@\n+[Unit]\n+Description=Periodic execution of wmf-beta-update-all.service\n+\n+[Timer]\n+Unit=wmf-beta-update-all.service\n+# Accuracy sets the maximum time interval around the execution time we want to allow\n+AccuracySec=15sec\n+OnCalendar=*:0/10\n+RandomizedDelaySec=0\n+\n+[Install]\n+WantedBy=multi-user.target", "parameters": "--- File[/lib/systemd/system/wmf-beta-update-all.timer].orig\n+++ File[/lib/systemd/system/wmf-beta-update-all.timer]\n\n+    ensure => present\n+    mode   => 0444\n+    owner  => root\n+    notify => Exec[systemd daemon-reload for wmf-beta-update-all.timer (wmf-beta-update-all.timer)]\n+    group  => root\n"}, {"resource": "Service[wmf-beta-update-all.timer]", "parameters": "--- Service[wmf-beta-update-all.timer].orig\n+++ Service[wmf-beta-update-all.timer]\n\n+    ensure   => running\n+    enable   => True\n+    provider => systemd\n"}, {"resource": "Logrotate::Conf[beta-autoupdater-prune-stale-logs]", "parameters": "--- Logrotate::Conf[beta-autoupdater-prune-stale-logs].orig\n+++ Logrotate::Conf[beta-autoupdater-prune-stale-logs]\n\n+    ensure => present\n"}, {"resource": "Systemd::Timer::Job[wmf-beta-update-all]", "parameters": "--- Systemd::Timer::Job[wmf-beta-update-all].orig\n+++ Systemd::Timer::Job[wmf-beta-update-all]\n\n+    command                   => /usr/local/bin/wmf-beta-update-all\n+    send_mail_only_on_error   => True\n+    success_exit_status       => []\n+    send_mail_to              => releng@lists.wikimedia.org\n+    fixed_random_delay        => False\n+    send_mail_from            => noreply@deployment-deploy04.deployment-prep.eqiad1.wikimedia.cloud\n+    interval                  => {'start': 'OnCalendar', 'interval': '*:0/10'}\n+    logging_enabled           => True\n+    ignore_errors             => False\n+    monitoring_enabled        => False\n+    logfile_group             => root\n+    environment               => {}\n+    syslog_force_stop         => True\n+    ensure                    => present\n+    description               => Update MediaWiki code, config, and databases\n+    user                      => jenkins-deploy\n+    logfile_basedir           => /var/log\n+    syslog_match_startswith   => True\n+    private_tmp               => False\n+    require                   => ['File[/srv/beta-update-logs]', 'File[/usr/local/bin/wmf-beta-update-all]', 'File[/usr/local/bin/wmf-beta-update-databases.py]']\n+    logfile_perms             => all\n+    monitoring_notes_url      => https://wikitech.wikimedia.org/wiki/Monitoring/systemd_unit_state\n+    logfile_name              => syslog.log\n+    send_mail                 => True\n+    monitoring_contact_groups => admins\n"}, {"resource": "Logrotate::Conf[wmf-beta-update-all]", "parameters": "--- Logrotate::Conf[wmf-beta-update-all].orig\n+++ Logrotate::Conf[wmf-beta-update-all]\n\n+    ensure => present\n"}, {"resource": "File[/etc/logrotate.d/wmf-beta-update-all]", "content": "--- /etc/logrotate.d/wmf-beta-update-all.orig\n+++ /etc/logrotate.d/wmf-beta-update-all\n@@ -0,0 +1,12 @@\n+# logrotate(8) config for wmf-beta-update-all\n+\n+/var/log/wmf-beta-update-all/*.log {\n+    daily\n+    copytruncate\n+    missingok\n+    compress\n+    delaycompress\n+    notifempty\n+    rotate 15\n+    size 256M\n+}", "parameters": "--- File[/etc/logrotate.d/wmf-beta-update-all].orig\n+++ File[/etc/logrotate.d/wmf-beta-update-all]\n\n+    ensure => present\n+    owner  => root\n+    mode   => 0444\n+    group  => root\n"}, {"resource": "Systemd::Timer[beta-autoupdater-prune-stale-logs]", "parameters": "--- Systemd::Timer[beta-autoupdater-prune-stale-logs].orig\n+++ Systemd::Timer[beta-autoupdater-prune-stale-logs]\n\n+    unit_name          => beta-autoupdater-prune-stale-logs.service\n+    ensure             => present\n+    timer_intervals    => [{'start': 'OnCalendar', 'interval': 'daily'}]\n+    accuracy           => 15sec\n+    fixed_random_delay => False\n+    splay              => 0\n"}, {"resource": "Exec[systemd daemon-reload for beta-autoupdater-prune-stale-logs.service (beta-autoupdater-prune-stale-logs.service)]", "parameters": "--- Exec[systemd daemon-reload for beta-autoupdater-prune-stale-logs.service (beta-autoupdater-prune-stale-logs.service)].orig\n+++ Exec[systemd daemon-reload for beta-autoupdater-prune-stale-logs.service (beta-autoupdater-prune-stale-logs.service)]\n\n+    command     => /bin/systemctl daemon-reload\n+    refreshonly => True\n"}, {"resource": "Systemd::Syslog[wmf-beta-update-all]", "parameters": "--- Systemd::Syslog[wmf-beta-update-all].orig\n+++ Systemd::Syslog[wmf-beta-update-all]\n\n+    force_stop             => True\n+    ensure                 => present\n+    base_dir               => /var/log\n+    programname_comparison => startswith\n+    log_filename           => syslog.log\n+    owner                  => jenkins-deploy\n+    readable_by            => all\n+    group                  => root\n"}, {"resource": "File[/usr/local/bin/wmf-beta-mwconfig-update]", "parameters": "--- File[/usr/local/bin/wmf-beta-mwconfig-update].orig\n+++ File[/usr/local/bin/wmf-beta-mwconfig-update]\n\n-    require => ['Package[git]', 'File[/etc/profile.d/mediawiki.sh]']\n-    source  => puppet:///modules/beta/wmf-beta-mwconfig-update\n-    mode    => 0555\n+    ensure  => absent\n"}, {"resource": "File[/lib/systemd/system/beta-autoupdater-prune-stale-logs.timer]", "content": "--- /lib/systemd/system/beta-autoupdater-prune-stale-logs.timer.orig\n+++ /lib/systemd/system/beta-autoupdater-prune-stale-logs.timer\n@@ -0,0 +1,12 @@\n+[Unit]\n+Description=Periodic execution of beta-autoupdater-prune-stale-logs.service\n+\n+[Timer]\n+Unit=beta-autoupdater-prune-stale-logs.service\n+# Accuracy sets the maximum time interval around the execution time we want to allow\n+AccuracySec=15sec\n+OnCalendar=daily\n+RandomizedDelaySec=0\n+\n+[Install]\n+WantedBy=multi-user.target", "parameters": "--- File[/lib/systemd/system/beta-autoupdater-prune-stale-logs.timer].orig\n+++ File[/lib/systemd/system/beta-autoupdater-prune-stale-logs.timer]\n\n+    ensure => present\n+    mode   => 0444\n+    owner  => root\n+    notify => Exec[systemd daemon-reload for beta-autoupdater-prune-stale-logs.timer (beta-autoupdater-prune-stale-logs.timer)]\n+    group  => root\n"}, {"resource": "Class[Beta::Autoupdater]", "parameters": "--- Class[Beta::Autoupdater].orig\n+++ Class[Beta::Autoupdater]\n\n+    update_interval => *:0/10\n+    run_updater     => True\n+    apache_fqdn     => beta-update.wmcloud.org\n"}], "perc_changed": "3.39%"}, "core": {"total": 2360, "only_in_self": [], "only_in_other": ["Exec[systemd daemon-reload for beta-autoupdater-prune-stale-logs.service (beta-autoupdater-prune-stale-logs.service)]", "Exec[systemd daemon-reload for beta-autoupdater-prune-stale-logs.timer (beta-autoupdater-prune-stale-logs.timer)]", "Exec[systemd daemon-reload for wmf-beta-update-all.service (wmf-beta-update-all.service)]", "Exec[systemd daemon-reload for wmf-beta-update-all.timer (wmf-beta-update-all.timer)]", "File[/etc/apache2/sites-available/50-beta-autoupdater.conf]", "File[/etc/apache2/sites-enabled/50-beta-autoupdater.conf]", "File[/etc/logrotate.d/beta-autoupdater-prune-stale-logs]", "File[/etc/logrotate.d/wmf-beta-update-all]", "File[/etc/rsyslog.d/40-beta-autoupdater-prune-stale-logs.conf]", "File[/etc/rsyslog.d/40-wmf-beta-update-all.conf]", "File[/lib/systemd/system/beta-autoupdater-prune-stale-logs.service]", "File[/lib/systemd/system/beta-autoupdater-prune-stale-logs.timer]", "File[/lib/systemd/system/wmf-beta-update-all.service]", "File[/lib/systemd/system/wmf-beta-update-all.timer]", "File[/srv/beta-update-logs]", "File[/usr/local/bin/wmf-beta-update-all]", "File[/var/log/beta-autoupdater-prune-stale-logs]", "File[/var/log/wmf-beta-update-all]", "Service[beta-autoupdater-prune-stale-logs.timer]", "Service[wmf-beta-update-all.timer]"], "resource_diffs": [{"resource": "File[/usr/local/bin/wmf-beta-autoupdate.py]", "content": "--- /usr/local/bin/wmf-beta-autoupdate.py.orig\n+++ /usr/local/bin/wmf-beta-autoupdate.py\n@@ -1,148 +0,0 @@\n-#!/usr/bin/env python\n-#######################################################################\n-# WARNING: this file is managed by Puppet\n-# puppet:///beta/wmf-beta-autoupdate.py.erb\n-#######################################################################\n-\n-\"\"\"\n-Updates MediaWiki core and extensions on the Beta cluster\n-\n-MUST be run as the `mwdeploy` user although that is not enforced by the script.\n-\"\"\"\n-\n-import argparse\n-import logging\n-import subprocess\n-import sys\n-\n-PATH_PORTAL = '/srv/mediawiki-staging/portal-master'\n-PATH_MWCORE = '/srv/mediawiki-staging/php-master'\n-PATH_MWEXT = '/srv/mediawiki-staging/php-master/extensions'\n-PATH_MWSKIN = '/srv/mediawiki-staging/php-master/skins'\n-PATH_VENDOR = '/srv/mediawiki-staging/php-master/vendor'\n-\n-\n-def main():\n-    \"\"\"\n-    Entry point for the script.\n-\n-    Parse script arguments, initialize the logger withnice colors and trigger\n-    the updating tasks.\n-\n-    Returns 0 on success of ALL tasks, 1 otherwise\n-    \"\"\"\n-    # Parse arguments, init logger to use some colors\n-\n-    options = parse_args()\n-    logging.basicConfig(level=options.log_level)\n-    # Color codes http://www.tldp.org/HOWTO/Bash-Prompt-HOWTO/x329.html\n-    logging.addLevelName(  # cyan\n-        logging.DEBUG, \"\\033[36m%s\\033[0m\" %\n-        logging.getLevelName(logging.DEBUG))\n-    logging.addLevelName(  # green\n-        logging.INFO, \"\\033[32m%s\\033[0m\" %\n-        logging.getLevelName(logging.INFO))\n-    logging.addLevelName(  # yellow\n-        logging.WARNING, \"\\033[33m%s\\033[0m\" %\n-        logging.getLevelName(logging.WARNING))\n-    logging.addLevelName(  # red\n-        logging.ERROR, \"\\033[31m%s\\033[0m\" %\n-        logging.getLevelName(logging.ERROR))\n-    logging.addLevelName(  # red background\n-        logging.CRITICAL, \"\\033[41m%s\\033[0m\" %\n-        logging.getLevelName(logging.CRITICAL))\n-\n-    logger = logging.getLogger('main')\n-\n-    logger.info(\"Starting updating tasks...\")\n-    # TODO refactor to use a dict with 'name' as keys and function value\n-    exit_codes = [\n-        pull_repo(name='mwcore', path=PATH_MWCORE),\n-        pull_repo(name='mwvendor', path=PATH_VENDOR),\n-        pull_repo(name='mwextpull', path=PATH_MWEXT),\n-        submodule_sync(name='mwextpull', path=PATH_MWEXT),\n-        update_repo(name='mwextupdate', path=PATH_MWEXT),\n-        pull_repo(name='mwskinpull', path=PATH_MWSKIN),\n-        submodule_sync(name='mwskinupdate', path=PATH_MWSKIN),\n-        update_repo(name='mwskinupdate', path=PATH_MWSKIN),\n-        pull_repo(name='portal', path=PATH_PORTAL),\n-    ]\n-\n-    logger.info(\"Executions completed %s\", exit_codes)\n-\n-    final_exit = 0\n-    for code in exit_codes:\n-        if code is not 0:\n-            final_exit = 1\n-            break\n-\n-    logger.info(\"Final exit code: %s\", final_exit)\n-    return final_exit\n-\n-\n-def parse_args():\n-    \"\"\"Parse command line arguments using argparse\"\"\"\n-\n-    parser = argparse.ArgumentParser(description=__doc__)\n-\n-    log_options = parser.add_mutually_exclusive_group()\n-    log_options.add_argument(\n-        '--debug', dest='log_level',\n-        action='store_const', const=logging.DEBUG,\n-        help='Print out internal processing')\n-    log_options.add_argument(\n-        '-v', '--verbose', '--info', dest='log_level',\n-        action='store_const', const=logging.INFO,\n-        help='Give a bit more information about what is going on')\n-    log_options.add_argument(\n-        '-q', '--quiet', dest='log_level',\n-        action='store_const', const=logging.WARNING,\n-        help='Only shows up warning and errors')\n-\n-    return parser.parse_args()\n-\n-\n-def git_head_ts(git_dir):\n-    \"\"\"Returns timestamp of the HEAD committer date\"\"\"\n-    proc = subprocess.check_output(\n-        ['git', '--git-dir', git_dir, 'log',\n-         '--pretty=tformat:%ct', '-1', 'HEAD'])\n-    return proc.rstrip('\\n')\n-\n-\n-def pull_repo(name, path):\n-    \"\"\"Pull repository at path\"\"\"\n-    return runner(name=name, path=path, cmd=['git', 'pull'])\n-\n-def submodule_sync(name, path):\n-    \"\"\"Syncs the submodules in path\"\"\"\n-    return runner(name=name, path=path, cmd=[\n-        'git', 'submodule', 'sync', '--recursive'])\n-\n-def update_repo(name, path):\n-    \"\"\"Registers and updates submodules in path\"\"\"\n-    return runner(name=name, path=path, cmd=[\n-        'git', 'submodule', 'update', '--init', '--recursive'])\n-\n-\n-def runner(cmd, path=None, name=None):\n-    \"\"\"Wrapper around subprocess.Popen with logging output\"\"\"\n-    log_target = name if name else 'runner'\n-    logger = logging.getLogger(log_target)\n-\n-    try:\n-        if path:\n-            logger.info(\"cwd: %s\", path)\n-        logger.info(\"running: %s\", ' '.join(cmd))\n-\n-        cmd = subprocess.Popen(args=cmd, cwd=path)\n-        exit_code = cmd.wait()\n-        logger.info(\"Exit code: %s\", exit_code)\n-    except OSError, exception:\n-        logger.error(exception)\n-        return False\n-\n-    return exit_code\n-\n-if __name__ == '__main__':\n-    sys.exit(main())", "parameters": "--- File[/usr/local/bin/wmf-beta-autoupdate.py].orig\n+++ File[/usr/local/bin/wmf-beta-autoupdate.py]\n\n-    require => Package[git]\n-    mode    => 0555\n+    ensure  => absent\n"}, {"resource": "File[/usr/local/bin/wmf-beta-mwconfig-update]", "parameters": "--- File[/usr/local/bin/wmf-beta-mwconfig-update].orig\n+++ File[/usr/local/bin/wmf-beta-mwconfig-update]\n\n-    require => ['Package[git]', 'File[/etc/profile.d/mediawiki.sh]']\n-    source  => puppet:///modules/beta/wmf-beta-mwconfig-update\n-    mode    => 0555\n+    ensure  => absent\n"}], "perc_changed": "0.93%"}, "main": {"total": 2360, "only_in_self": [], "only_in_other": ["Exec[systemd daemon-reload for beta-autoupdater-prune-stale-logs.service (beta-autoupdater-prune-stale-logs.service)]", "Exec[systemd daemon-reload for beta-autoupdater-prune-stale-logs.timer (beta-autoupdater-prune-stale-logs.timer)]", "Exec[systemd daemon-reload for wmf-beta-update-all.service (wmf-beta-update-all.service)]", "Exec[systemd daemon-reload for wmf-beta-update-all.timer (wmf-beta-update-all.timer)]", "File[/etc/apache2/sites-available/50-beta-autoupdater.conf]", "File[/etc/apache2/sites-enabled/50-beta-autoupdater.conf]", "File[/etc/logrotate.d/beta-autoupdater-prune-stale-logs]", "File[/etc/logrotate.d/wmf-beta-update-all]", "File[/etc/rsyslog.d/40-beta-autoupdater-prune-stale-logs.conf]", "File[/etc/rsyslog.d/40-wmf-beta-update-all.conf]", "File[/lib/systemd/system/beta-autoupdater-prune-stale-logs.service]", "File[/lib/systemd/system/beta-autoupdater-prune-stale-logs.timer]", "File[/lib/systemd/system/wmf-beta-update-all.service]", "File[/lib/systemd/system/wmf-beta-update-all.timer]", "File[/srv/beta-update-logs]", "File[/usr/local/bin/wmf-beta-update-all]", "File[/var/log/beta-autoupdater-prune-stale-logs]", "File[/var/log/wmf-beta-update-all]", "Httpd::Conf[beta-autoupdater]", "Httpd::Site[beta-autoupdater]", "Logrotate::Conf[beta-autoupdater-prune-stale-logs]", "Logrotate::Conf[wmf-beta-update-all]", "Rsyslog::Conf[beta-autoupdater-prune-stale-logs]", "Rsyslog::Conf[wmf-beta-update-all]", "Service[beta-autoupdater-prune-stale-logs.timer]", "Service[wmf-beta-update-all.timer]", "Systemd::Service[beta-autoupdater-prune-stale-logs]", "Systemd::Service[wmf-beta-update-all]", "Systemd::Syslog[beta-autoupdater-prune-stale-logs]", "Systemd::Syslog[wmf-beta-update-all]", "Systemd::Timer::Job[beta-autoupdater-prune-stale-logs]", "Systemd::Timer::Job[wmf-beta-update-all]", "Systemd::Timer[beta-autoupdater-prune-stale-logs]", "Systemd::Timer[wmf-beta-update-all]", "Systemd::Unit[beta-autoupdater-prune-stale-logs.service]", "Systemd::Unit[beta-autoupdater-prune-stale-logs.timer]", "Systemd::Unit[wmf-beta-update-all.service]", "Systemd::Unit[wmf-beta-update-all.timer]"], "resource_diffs": [{"resource": "Class[Profile::Beta::Autoupdater]", "parameters": "--- Class[Profile::Beta::Autoupdater].orig\n+++ Class[Profile::Beta::Autoupdater]\n\n+    update_interval => *:0/10\n+    run_updater     => True\n+    apache_fqdn     => beta-update.wmcloud.org\n"}, {"resource": "File[/usr/local/bin/wmf-beta-autoupdate.py]", "content": "--- /usr/local/bin/wmf-beta-autoupdate.py.orig\n+++ /usr/local/bin/wmf-beta-autoupdate.py\n@@ -1,148 +0,0 @@\n-#!/usr/bin/env python\n-#######################################################################\n-# WARNING: this file is managed by Puppet\n-# puppet:///beta/wmf-beta-autoupdate.py.erb\n-#######################################################################\n-\n-\"\"\"\n-Updates MediaWiki core and extensions on the Beta cluster\n-\n-MUST be run as the `mwdeploy` user although that is not enforced by the script.\n-\"\"\"\n-\n-import argparse\n-import logging\n-import subprocess\n-import sys\n-\n-PATH_PORTAL = '/srv/mediawiki-staging/portal-master'\n-PATH_MWCORE = '/srv/mediawiki-staging/php-master'\n-PATH_MWEXT = '/srv/mediawiki-staging/php-master/extensions'\n-PATH_MWSKIN = '/srv/mediawiki-staging/php-master/skins'\n-PATH_VENDOR = '/srv/mediawiki-staging/php-master/vendor'\n-\n-\n-def main():\n-    \"\"\"\n-    Entry point for the script.\n-\n-    Parse script arguments, initialize the logger withnice colors and trigger\n-    the updating tasks.\n-\n-    Returns 0 on success of ALL tasks, 1 otherwise\n-    \"\"\"\n-    # Parse arguments, init logger to use some colors\n-\n-    options = parse_args()\n-    logging.basicConfig(level=options.log_level)\n-    # Color codes http://www.tldp.org/HOWTO/Bash-Prompt-HOWTO/x329.html\n-    logging.addLevelName(  # cyan\n-        logging.DEBUG, \"\\033[36m%s\\033[0m\" %\n-        logging.getLevelName(logging.DEBUG))\n-    logging.addLevelName(  # green\n-        logging.INFO, \"\\033[32m%s\\033[0m\" %\n-        logging.getLevelName(logging.INFO))\n-    logging.addLevelName(  # yellow\n-        logging.WARNING, \"\\033[33m%s\\033[0m\" %\n-        logging.getLevelName(logging.WARNING))\n-    logging.addLevelName(  # red\n-        logging.ERROR, \"\\033[31m%s\\033[0m\" %\n-        logging.getLevelName(logging.ERROR))\n-    logging.addLevelName(  # red background\n-        logging.CRITICAL, \"\\033[41m%s\\033[0m\" %\n-        logging.getLevelName(logging.CRITICAL))\n-\n-    logger = logging.getLogger('main')\n-\n-    logger.info(\"Starting updating tasks...\")\n-    # TODO refactor to use a dict with 'name' as keys and function value\n-    exit_codes = [\n-        pull_repo(name='mwcore', path=PATH_MWCORE),\n-        pull_repo(name='mwvendor', path=PATH_VENDOR),\n-        pull_repo(name='mwextpull', path=PATH_MWEXT),\n-        submodule_sync(name='mwextpull', path=PATH_MWEXT),\n-        update_repo(name='mwextupdate', path=PATH_MWEXT),\n-        pull_repo(name='mwskinpull', path=PATH_MWSKIN),\n-        submodule_sync(name='mwskinupdate', path=PATH_MWSKIN),\n-        update_repo(name='mwskinupdate', path=PATH_MWSKIN),\n-        pull_repo(name='portal', path=PATH_PORTAL),\n-    ]\n-\n-    logger.info(\"Executions completed %s\", exit_codes)\n-\n-    final_exit = 0\n-    for code in exit_codes:\n-        if code is not 0:\n-            final_exit = 1\n-            break\n-\n-    logger.info(\"Final exit code: %s\", final_exit)\n-    return final_exit\n-\n-\n-def parse_args():\n-    \"\"\"Parse command line arguments using argparse\"\"\"\n-\n-    parser = argparse.ArgumentParser(description=__doc__)\n-\n-    log_options = parser.add_mutually_exclusive_group()\n-    log_options.add_argument(\n-        '--debug', dest='log_level',\n-        action='store_const', const=logging.DEBUG,\n-        help='Print out internal processing')\n-    log_options.add_argument(\n-        '-v', '--verbose', '--info', dest='log_level',\n-        action='store_const', const=logging.INFO,\n-        help='Give a bit more information about what is going on')\n-    log_options.add_argument(\n-        '-q', '--quiet', dest='log_level',\n-        action='store_const', const=logging.WARNING,\n-        help='Only shows up warning and errors')\n-\n-    return parser.parse_args()\n-\n-\n-def git_head_ts(git_dir):\n-    \"\"\"Returns timestamp of the HEAD committer date\"\"\"\n-    proc = subprocess.check_output(\n-        ['git', '--git-dir', git_dir, 'log',\n-         '--pretty=tformat:%ct', '-1', 'HEAD'])\n-    return proc.rstrip('\\n')\n-\n-\n-def pull_repo(name, path):\n-    \"\"\"Pull repository at path\"\"\"\n-    return runner(name=name, path=path, cmd=['git', 'pull'])\n-\n-def submodule_sync(name, path):\n-    \"\"\"Syncs the submodules in path\"\"\"\n-    return runner(name=name, path=path, cmd=[\n-        'git', 'submodule', 'sync', '--recursive'])\n-\n-def update_repo(name, path):\n-    \"\"\"Registers and updates submodules in path\"\"\"\n-    return runner(name=name, path=path, cmd=[\n-        'git', 'submodule', 'update', '--init', '--recursive'])\n-\n-\n-def runner(cmd, path=None, name=None):\n-    \"\"\"Wrapper around subprocess.Popen with logging output\"\"\"\n-    log_target = name if name else 'runner'\n-    logger = logging.getLogger(log_target)\n-\n-    try:\n-        if path:\n-            logger.info(\"cwd: %s\", path)\n-        logger.info(\"running: %s\", ' '.join(cmd))\n-\n-        cmd = subprocess.Popen(args=cmd, cwd=path)\n-        exit_code = cmd.wait()\n-        logger.info(\"Exit code: %s\", exit_code)\n-    except OSError, exception:\n-        logger.error(exception)\n-        return False\n-\n-    return exit_code\n-\n-if __name__ == '__main__':\n-    sys.exit(main())", "parameters": "--- File[/usr/local/bin/wmf-beta-autoupdate.py].orig\n+++ File[/usr/local/bin/wmf-beta-autoupdate.py]\n\n-    require => Package[git]\n-    mode    => 0555\n+    ensure  => absent\n"}, {"resource": "File[/usr/local/bin/wmf-beta-mwconfig-update]", "parameters": "--- File[/usr/local/bin/wmf-beta-mwconfig-update].orig\n+++ File[/usr/local/bin/wmf-beta-mwconfig-update]\n\n-    require => ['Package[git]', 'File[/etc/profile.d/mediawiki.sh]']\n-    source  => puppet:///modules/beta/wmf-beta-mwconfig-update\n-    mode    => 0555\n+    ensure  => absent\n"}, {"resource": "Class[Beta::Autoupdater]", "parameters": "--- Class[Beta::Autoupdater].orig\n+++ Class[Beta::Autoupdater]\n\n+    update_interval => *:0/10\n+    run_updater     => True\n+    apache_fqdn     => beta-update.wmcloud.org\n"}], "perc_changed": "1.78%"}}}