Skip to content

Instantly share code, notes, and snippets.

irb(main):034:0> checksum_base_path='file:///tmp/'
=> "file:///tmp/"
irb(main):035:0> uri = URI.join(checksum_base_path, "apache-tomcat-8.0.36.tar.gz.md5")
=> #<URI::Generic file:/tmp/apache-tomcat-8.0.36.tar.gz.md5>
irb(main):036:0> open(uri.to_s).read.split(' ')[0]
Errno::ENOENT: No such file or directory @ rb_sysopen - file:/tmp/apache-tomcat-8.0.36.tar.gz.md5
from /usr/share/ruby/open-uri.rb:37:in `initialize'
from /usr/share/ruby/open-uri.rb:37:in `open'
from /usr/share/ruby/open-uri.rb:37:in `open'
from (irb):36
Aug 02, 2016 12:54:15 PM org.apache.catalina.core.AprLifecycleListener init
SEVERE: An incompatible version 1.1.34 of the APR based Apache Tomcat Native library is installed, while Tomcat requires version 1.2.6
Aug 02, 2016 12:54:15 PM org.apache.catalina.core.AprLifecycleListener init
SEVERE: An incompatible version 1.1.34 of the APR based Apache Tomcat Native library is installed, while Tomcat requires version 1.2.6
Aug 02, 2016 12:54:15 PM org.apache.catalina.core.AprLifecycleListener init
SEVERE: An incompatible version 1.1.34 of the APR based Apache Tomcat Native library is installed, while Tomcat requires version 1.2.6
Aug 02, 2016 12:54:15 PM org.apache.catalina.core.AprLifecycleListener init
SEVERE: An incompatible version 1.1.34 of the APR based Apache Tomcat Native library is installed, while Tomcat requires version 1.2.6
Aug 02, 2016 12:54:15 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.
vagrant@broken-selinux-fedora-23 recipes]$ pwd
/tmp/kitchen/cookbooks/selinux_policy_test/recipes
[vagrant@broken-selinux-fedora-23 recipes]$ grep BLA fcontext.rb
not_if "echo BLA1 ; stat -c %C #{dir_name} | grep #{context}"
not_if "echo BLA2; stat -c %C #{dir_name} | grep #{context2}"
[vagrant@broken-selinux-fedora-23 ~]$ stat -c %C /var/www/tester
unconfined_u:object_r:boot_t:s0
[vagrant@broken-selinux-fedora-23 ~]$ sudo -E /opt/chef/bin/chef-client --local-mode --config /tmp/kitchen/client.rb --log_level auto --force-formatter --
@equick
equick / gist:bf4ce60c448b9b20e2ebb8baba873303
Created June 23, 2016 17:36
broken-selinux-fedora-23 kitchen test
-bash-4.3$ kitchen converge broken-selinux-fedora-23
-----> Starting Kitchen (v1.8.0)
-----> Creating <broken-selinux-fedora-23>...
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'bento/fedora-23'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'bento/fedora-23' is up to date...
==> default: Setting the name of the VM: kitchen-chef-selinuxpolicy-1-broken-selinux-fedora-23_default_1466702992611_70977
==> default: Fixed port collision for 22 => 2222. Now on port 2203.
==> default: Clearing any previously set network interfaces...
@equick
equick / gist:694ff094fe890bac50de2fecc54a157f
Created June 23, 2016 17:28
broken-selinux-fedora-22 kitchen test
-bash-4.3$ kitchen converge broken-selinux-fedora-22
-----> Starting Kitchen (v1.8.0)
-----> Creating <broken-selinux-fedora-22>...
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'bento/fedora-22'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'bento/fedora-22' is up to date...
==> default: Setting the name of the VM: kitchen-chef-selinuxpolicy-1-broken-selinux-fedora-22_default_1466701902224_18189
==> default: Fixed port collision for 22 => 2222. Now on port 2202.
==> default: Clearing any previously set network interfaces...
@equick
equick / gist:a21cb38e1f9e7fe79ad6375fbff5b825
Created June 23, 2016 17:10
default-centos-6-chef-11 kitchen test
-bash-4.3$ kitchen converge default-centos-6-chef-11
-----> Starting Kitchen (v1.8.0)
-----> Creating <default-centos-6-chef-11>...
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'opscode-centos-6.7'...
==> default: Matching MAC address for NAT networking...
==> default: Setting the name of the VM: kitchen-chef-selinuxpolicy-1-default-centos-6-chef-11_default_1466700195079_40519
==> default: Fixed port collision for 22 => 2222. Now on port 2201.
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
@equick
equick / gist:c1fee501446a8912674393e88e8512cf
Created June 23, 2016 16:41
default-centos-67 kitchen test
-bash-4.3$ kitchen converge default-centos-67
-----> Starting Kitchen (v1.8.0)
-----> Converging <default-centos-67>...
Preparing files for transfer
Preparing dna.json
Resolving cookbook dependencies with Berkshelf 4.3.3...
Removing non-cookbook files before transfer
Preparing validation.pem
Preparing client.rb
-----> Installing Chef Omnibus (always install latest version)
@equick
equick / gist:605ecfe4b1da15e4694de68f59faa27d
Created June 23, 2016 16:34
default-centos-72 kitchen test
-bash-4.3$ kitchen create default-centos-72
-----> Starting Kitchen (v1.8.0)
-----> Creating <default-centos-72>...
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'bento/centos-7.2'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'bento/centos-7.2' is up to date...
==> default: A newer version of the box 'bento/centos-7.2' is available! You currently
==> default: have version '2.2.6'. The latest is version '2.2.7'. Run
==> default: `vagrant box update` to update.
* ruby_block[fail-range] action nothing (skipped due to action :nothing)
* execute[/usr/sbin/semanage port -a -t http_port_t -p tcp 1900-1902] action run
- execute /usr/sbin/semanage port -a -t http_port_t -p tcp 1900-1902
* selinux_policy_port[1901] action addormodify
* execute[selinux-port-1901-add] action run (skipped due to not_if)
(up to date)
* execute[selinux-port-1901-modify] action run (skipped due to not_if)
(up to date)
(up to date)
Recipe: selinux_policy_test::bad_port
bash-4.3$ chef --version
Chef Development Kit Version: 0.12.0
chef-client version: 12.8.1
berks version: 4.3.0
kitchen version: 1.6.0
bash-4.3$ chef-client -z vagrant_linux.rb mycluster.rb
[2016-04-24T21:50:36+01:00] INFO: Started chef-zero at chefzero://localhost:8889 with repository at /home/quick/chef
One version per cookbook