voxpupuli / puppet-cassandra

Installs Cassandra & DataStax Agent on RHEL/Ubuntu/Debian.
https://forge.puppetlabs.com/puppet/cassandra
Apache License 2.0
13 stars 65 forks source link

Migrate contents of ./scripts directory to rake tasks. #311

Closed dallinb closed 7 years ago

dallinb commented 7 years ago

http://nvie.com/posts/a-successful-git-branching-model/ http://stackoverflow.com/questions/825748/how-to-pass-command-line-arguments-to-a-rake-task https://github.com/octokit/octokit.rb https://edelpero.svbtle.com/everything-you-always-wanted-to-know-about-writing-good-rake-tasks-but-were-afraid-to-ask https://github.com/schacon/ruby-git http://serverspec.org/advanced_tips.html

dallinb commented 7 years ago

Need to add:

docker_image_commands:
   - 'apt-get install -y locales-all net-tools sudo ufw wget ntp python-pip python-minimal'
   - 'rm -f /usr/sbin/policy-rc.d'

Output from Ubuntu 16.

  Info: Loading facts
  Info: Loading facts
  Info: Loading facts
  Info: Loading facts
  Notice: Compiled catalog for ubuntu1604 in environment production in 0.87 seconds
  Info: Applying configuration version '1479039847'
  Notice: /Stage[main]/Cassandra::Java/Package[libjna-java]/ensure: ensure changed 'purged' to 'present'
  Notice: /Stage[main]/Cassandra::Firewall_ports/Cassandra::Private::Firewall_ports::Rule[220_Client_0.0.0.0/0]/Firewall[220 - Cassandra (Client) - 0.0.0.0/0]/ensure: created
  Warning: Firewall[220 - Cassandra (Client) - 0.0.0.0/0](provider=iptables): Unable to persist firewall rules: Execution of '/usr/sbin/service iptables-persistent save' returned 1: iptables-persistent: unrecognized service
  Notice: /Stage[main]/Cassandra::Firewall_ports/Cassandra::Private::Firewall_ports::Rule[210_InterNode_0.0.0.0/0]/Firewall[210 - Cassandra (InterNode) - 0.0.0.0/0]/ensure: created
  Warning: Firewall[210 - Cassandra (InterNode) - 0.0.0.0/0](provider=iptables): Unable to persist firewall rules: Execution of '/usr/sbin/service iptables-persistent save' returned 1: iptables-persistent: unrecognized service
  Notice: /Stage[main]/Cassandra::Firewall_ports/Cassandra::Private::Firewall_ports::Rule[230_OpsCenter_0.0.0.0/0]/Firewall[230 - Cassandra (OpsCenter) - 0.0.0.0/0]/ensure: created
  Warning: Firewall[230 - Cassandra (OpsCenter) - 0.0.0.0/0](provider=iptables): Unable to persist firewall rules: Execution of '/usr/sbin/service iptables-persistent save' returned 1: iptables-persistent: unrecognized service
  Notice: /Stage[main]/Cassandra::Firewall_ports/Cassandra::Private::Firewall_ports::Rule[200_Public_0.0.0.0/0]/Firewall[200 - Cassandra (Public) - 0.0.0.0/0]/ensure: created
  Warning: Firewall[200 - Cassandra (Public) - 0.0.0.0/0](provider=iptables): Unable to persist firewall rules: Execution of '/usr/sbin/service iptables-persistent save' returned 1: iptables-persistent: unrecognized service
  Notice: /Stage[main]/Main/Exec[/usr/bin/wget http://launchpadlibrarian.net/109052632/python-support_1.0.15_all.deb]/returns: executed successfully
  Info: /Stage[main]/Main/Exec[/usr/bin/wget http://launchpadlibrarian.net/109052632/python-support_1.0.15_all.deb]: Scheduling refresh of Exec[/usr/bin/dpkg -i /var/tmp/python-support_1.0.15_all.deb]
  Notice: /Stage[main]/Main/Exec[/usr/bin/dpkg -i /var/tmp/python-support_1.0.15_all.deb]/returns: Selecting previously unselected package python-support.
  Notice: /Stage[main]/Main/Exec[/usr/bin/dpkg -i /var/tmp/python-support_1.0.15_all.deb]/returns: (Reading database ... 57176 files and directories currently installed.)
  Notice: /Stage[main]/Main/Exec[/usr/bin/dpkg -i /var/tmp/python-support_1.0.15_all.deb]/returns: Preparing to unpack .../python-support_1.0.15_all.deb ...
  Notice: /Stage[main]/Main/Exec[/usr/bin/dpkg -i /var/tmp/python-support_1.0.15_all.deb]/returns: Unpacking python-support (1.0.15) ...
  Notice: /Stage[main]/Main/Exec[/usr/bin/dpkg -i /var/tmp/python-support_1.0.15_all.deb]/returns: dpkg: dependency problems prevent configuration of python-support:
  Notice: /Stage[main]/Main/Exec[/usr/bin/dpkg -i /var/tmp/python-support_1.0.15_all.deb]/returns:  python-support depends on python (>= 2.5); however:
  Notice: /Stage[main]/Main/Exec[/usr/bin/dpkg -i /var/tmp/python-support_1.0.15_all.deb]/returns:   Package python is not installed.
  Notice: /Stage[main]/Main/Exec[/usr/bin/dpkg -i /var/tmp/python-support_1.0.15_all.deb]/returns:  python-support depends on python-minimal; however:
  Notice: /Stage[main]/Main/Exec[/usr/bin/dpkg -i /var/tmp/python-support_1.0.15_all.deb]/returns:   Package python-minimal is not installed.
  Notice: /Stage[main]/Main/Exec[/usr/bin/dpkg -i /var/tmp/python-support_1.0.15_all.deb]/returns: 
  Notice: /Stage[main]/Main/Exec[/usr/bin/dpkg -i /var/tmp/python-support_1.0.15_all.deb]/returns: dpkg: error processing package python-support (--install):
  Notice: /Stage[main]/Main/Exec[/usr/bin/dpkg -i /var/tmp/python-support_1.0.15_all.deb]/returns:  dependency problems - leaving unconfigured
  Notice: /Stage[main]/Main/Exec[/usr/bin/dpkg -i /var/tmp/python-support_1.0.15_all.deb]/returns: Processing triggers for man-db (2.7.5-1) ...
  Notice: /Stage[main]/Main/Exec[/usr/bin/dpkg -i /var/tmp/python-support_1.0.15_all.deb]/returns: Errors were encountered while processing:
  Notice: /Stage[main]/Main/Exec[/usr/bin/dpkg -i /var/tmp/python-support_1.0.15_all.deb]/returns:  python-support
  Error: /Stage[main]/Main/Exec[/usr/bin/dpkg -i /var/tmp/python-support_1.0.15_all.deb]: Failed to call refresh: /usr/bin/dpkg -i /var/tmp/python-support_1.0.15_all.deb returned 1 instead of one of [0]
  Error: /Stage[main]/Main/Exec[/usr/bin/dpkg -i /var/tmp/python-support_1.0.15_all.deb]: /usr/bin/dpkg -i /var/tmp/python-support_1.0.15_all.deb returned 1 instead of one of [0]
  Error: Could not set 'present' on ensure: Could not locate the pip command. at 39:/tmp/apply_manifest.pp.NS0GEZ
  Error: Could not set 'present' on ensure: Could not locate the pip command. at 39:/tmp/apply_manifest.pp.NS0GEZ
  Wrapped exception:
  Could not locate the pip command.
  Error: /Stage[main]/Main/Package[cassandra-driver]/ensure: change from absent to present failed: Could not set 'present' on ensure: Could not locate the pip command. at 39:/tmp/apply_manifest.pp.NS0GEZ
  Info: Computing checksum on file /etc/apt/apt.conf.d/15update-stamp
  Info: /Stage[main]/Apt/Apt::Setting[conf-update-stamp]/File[/etc/apt/apt.conf.d/15update-stamp]: Filebucketed /etc/apt/apt.conf.d/15update-stamp to puppet with sum b9de0ac9e2c9854b1bb213e362dc4e41
  Notice: /Stage[main]/Apt/Apt::Setting[conf-update-stamp]/File[/etc/apt/apt.conf.d/15update-stamp]/content: content changed '{md5}b9de0ac9e2c9854b1bb213e362dc4e41' to '{md5}0962d70c4ec78bbfa6f3544ae0c41974'
  Info: /Stage[main]/Apt/Apt::Setting[conf-update-stamp]/File[/etc/apt/apt.conf.d/15update-stamp]: Scheduling refresh of Class[Apt::Update]
  Notice: /Stage[main]/Apt/File[preferences]/ensure: created
  Info: /Stage[main]/Apt/File[preferences]: Scheduling refresh of Class[Apt::Update]
  Notice: /Stage[main]/Cassandra::Java/Apt::Key[OpenJDK]/Apt_key[OpenJDK]/ensure: created
  Notice: /Stage[main]/Cassandra::Datastax_repo/Apt::Key[datastaxkey]/Apt_key[datastaxkey]/ensure: created
  Notice: /Stage[main]/Cassandra::Datastax_repo/Apt::Source[datastax]/Apt::Setting[list-datastax]/File[/etc/apt/sources.list.d/datastax.list]/ensure: created
  Info: /Stage[main]/Cassandra::Datastax_repo/Apt::Source[datastax]/Apt::Setting[list-datastax]/File[/etc/apt/sources.list.d/datastax.list]: Scheduling refresh of Class[Apt::Update]
  Info: Apt::Source[datastax]: Scheduling refresh of Exec[update-cassandra-repos]
  Notice: /Stage[main]/Cassandra::Java/Apt::Source[OpenJDK]/Apt::Setting[list-OpenJDK]/File[/etc/apt/sources.list.d/OpenJDK.list]/ensure: created
  Info: /Stage[main]/Cassandra::Java/Apt::Source[OpenJDK]/Apt::Setting[list-OpenJDK]/File[/etc/apt/sources.list.d/OpenJDK.list]: Scheduling refresh of Class[Apt::Update]
  Info: Class[Apt::Update]: Scheduling refresh of Exec[apt_update]
  Notice: /Stage[main]/Apt::Update/Exec[apt_update]: Triggered 'refresh' from 1 events
  Info: Apt::Source[OpenJDK]: Scheduling refresh of Exec[cassandra::java::apt_update]
  Notice: /Stage[main]/Cassandra::Java/Exec[cassandra::java::apt_update]: Triggered 'refresh' from 1 events
  Notice: /Stage[main]/Cassandra::Datastax_repo/Exec[update-cassandra-repos]: Triggered 'refresh' from 1 events
  Error: Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold install openjdk-8-jdk' returned 100: Reading package lists...
  Building dependency tree...
  Reading state information...
  You might want to run 'apt-get -f install' to correct these:
  The following packages have unmet dependencies:
   openjdk-8-jdk : Depends: openjdk-8-jre (= 8u111-b14-2ubuntu0.16.04.2) but it is not going to be installed
                   Depends: openjdk-8-jdk-headless (= 8u111-b14-2ubuntu0.16.04.2) but it is not going to be installed
                   Recommends: libxt-dev but it is not going to be installed
   python-support : Depends: python (>= 2.5) but it is not going to be installed
                    Depends: python-minimal but it is not going to be installed
  E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
  Error: /Stage[main]/Cassandra::Java/Package[openjdk-8-jdk]/ensure: change from purged to present failed: Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold install openjdk-8-jdk' returned 100: Reading package lists...
  Building dependency tree...
  Reading state information...
  You might want to run 'apt-get -f install' to correct these:
  The following packages have unmet dependencies:
   openjdk-8-jdk : Depends: openjdk-8-jre (= 8u111-b14-2ubuntu0.16.04.2) but it is not going to be installed
                   Depends: openjdk-8-jdk-headless (= 8u111-b14-2ubuntu0.16.04.2) but it is not going to be installed
                   Recommends: libxt-dev but it is not going to be installed
   python-support : Depends: python (>= 2.5) but it is not going to be installed
                    Depends: python-minimal but it is not going to be installed
  E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
  Notice: /Group[cassandra]: Dependency Package[openjdk-8-jdk] has failures: true
  Notice: /Group[cassandra]: Dependency Package[cassandra-driver] has failures: true
  Warning: /Group[cassandra]: Skipping because of failed dependencies
  Notice: /Stage[main]/Cassandra/File[/etc/init.d/cassandra]: Dependency Package[openjdk-8-jdk] has failures: true
  Notice: /Stage[main]/Cassandra/File[/etc/init.d/cassandra]: Dependency Package[cassandra-driver] has failures: true
  Warning: /Stage[main]/Cassandra/File[/etc/init.d/cassandra]: Skipping because of failed dependencies
  Notice: /User[cassandra]: Dependency Package[openjdk-8-jdk] has failures: true
  Notice: /User[cassandra]: Dependency Package[cassandra-driver] has failures: true
  Warning: /User[cassandra]: Skipping because of failed dependencies
  Notice: /Stage[main]/Cassandra/File[/etc/cassandra]: Dependency Package[openjdk-8-jdk] has failures: true
  Notice: /Stage[main]/Cassandra/File[/etc/cassandra]: Dependency Package[cassandra-driver] has failures: true
  Warning: /Stage[main]/Cassandra/File[/etc/cassandra]: Skipping because of failed dependencies
  Notice: /Stage[main]/Cassandra/File[/etc/cassandra/cassandra-rackdc.properties]: Dependency Package[openjdk-8-jdk] has failures: true
  Notice: /Stage[main]/Cassandra/File[/etc/cassandra/cassandra-rackdc.properties]: Dependency Package[cassandra-driver] has failures: true
  Warning: /Stage[main]/Cassandra/File[/etc/cassandra/cassandra-rackdc.properties]: Skipping because of failed dependencies
  Notice: /Stage[main]/Cassandra/File[/etc/cassandra/cassandra.yaml]: Dependency Package[openjdk-8-jdk] has failures: true
  Notice: /Stage[main]/Cassandra/File[/etc/cassandra/cassandra.yaml]: Dependency Package[cassandra-driver] has failures: true
  Warning: /Stage[main]/Cassandra/File[/etc/cassandra/cassandra.yaml]: Skipping because of failed dependencies
  Notice: /Package[cassandra]: Dependency Package[openjdk-8-jdk] has failures: true
  Notice: /Package[cassandra]: Dependency Package[cassandra-driver] has failures: true
  Warning: /Package[cassandra]: Skipping because of failed dependencies
  Notice: /Stage[main]/Cassandra/Exec[cassandra_reload_systemctl]: Dependency Package[openjdk-8-jdk] has failures: true
  Notice: /Stage[main]/Cassandra/Exec[cassandra_reload_systemctl]: Dependency Package[cassandra-driver] has failures: true
  Warning: /Stage[main]/Cassandra/Exec[cassandra_reload_systemctl]: Skipping because of failed dependencies
  Notice: /Stage[main]/Cassandra/Exec[CASSANDRA-2356 sleep]: Dependency Package[openjdk-8-jdk] has failures: true
  Notice: /Stage[main]/Cassandra/Exec[CASSANDRA-2356 sleep]: Dependency Package[cassandra-driver] has failures: true
  Warning: /Stage[main]/Cassandra/Exec[CASSANDRA-2356 sleep]: Skipping because of failed dependencies
  Notice: /Stage[main]/Cassandra/Service[cassandra]: Dependency Package[openjdk-8-jdk] has failures: true
  Notice: /Stage[main]/Cassandra/Service[cassandra]: Dependency Package[cassandra-driver] has failures: true
  Warning: /Stage[main]/Cassandra/Service[cassandra]: Skipping because of failed dependencies
  Notice: /Package[cassandra-tools]: Dependency Package[openjdk-8-jdk] has failures: true
  Notice: /Package[cassandra-tools]: Dependency Package[cassandra-driver] has failures: true
  Warning: /Package[cassandra-tools]: Skipping because of failed dependencies
  Notice: /Package[datastax-agent]: Dependency Package[openjdk-8-jdk] has failures: true
  Notice: /Package[datastax-agent]: Dependency Package[cassandra-driver] has failures: true
  Warning: /Package[datastax-agent]: Skipping because of failed dependencies
  Notice: /Stage[main]/Cassandra::Datastax_agent/Exec[datastax_agent_reload_systemctl]: Dependency Package[openjdk-8-jdk] has failures: true
  Notice: /Stage[main]/Cassandra::Datastax_agent/Exec[datastax_agent_reload_systemctl]: Dependency Package[cassandra-driver] has failures: true
  Warning: /Stage[main]/Cassandra::Datastax_agent/Exec[datastax_agent_reload_systemctl]: Skipping because of failed dependencies
  Notice: /Stage[main]/Cassandra::Datastax_agent/Service[datastax-agent]: Dependency Package[openjdk-8-jdk] has failures: true
  Notice: /Stage[main]/Cassandra::Datastax_agent/Service[datastax-agent]: Dependency Package[cassandra-driver] has failures: true
  Warning: /Stage[main]/Cassandra::Datastax_agent/Service[datastax-agent]: Skipping because of failed dependencies
  Notice: /Stage[main]/Cassandra::Datastax_agent/File[/var/lib/datastax-agent/conf/address.yaml]: Dependency Package[openjdk-8-jdk] has failures: true
  Notice: /Stage[main]/Cassandra::Datastax_agent/File[/var/lib/datastax-agent/conf/address.yaml]: Dependency Package[cassandra-driver] has failures: true
  Warning: /Stage[main]/Cassandra::Datastax_agent/File[/var/lib/datastax-agent/conf/address.yaml]: Skipping because of failed dependencies
  Notice: /Stage[main]/Main/Exec[/bin/chown root:root /etc/apt/sources.list.d/datastax.list]: Dependency Package[openjdk-8-jdk] has failures: true
  Notice: /Stage[main]/Main/Exec[/bin/chown root:root /etc/apt/sources.list.d/datastax.list]: Dependency Package[cassandra-driver] has failures: true
  Warning: /Stage[main]/Main/Exec[/bin/chown root:root /etc/apt/sources.list.d/datastax.list]: Skipping because of failed dependencies
  Info: Creating state file /var/lib/puppet/state/state.yaml
  Notice: Finished catalog run in 10.01 seconds

ubuntu1604 executed in 15.18 seconds
Exited: 6
    should work with no errors (FAILED - 1)