Skip to content

Instantly share code, notes, and snippets.

@rafaelportela
Created June 30, 2015 22:10
Show Gist options
  • Save rafaelportela/a9410c68bf4d197f1579 to your computer and use it in GitHub Desktop.
Save rafaelportela/a9410c68bf4d197f1579 to your computer and use it in GitHub Desktop.
Puppet script to install java automatically accepting licences
file { '/etc/apt/sources.list.d/webupd8team.list':
content => "deb http://ppa.launchpad.net/webupd8team/java/ubuntu lucid main\ndeb-src http://ppa.launchpad.net/webupd8team/java/ubuntu lucid main\n",
} ->
exec { 'add-webupd8-key':
command => 'apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EEA14886',
path => ['/usr/bin/', '/bin'],
} ->
exec { 'apt-key-update':
command => 'apt-key update',
path => ['/usr/bin/', '/bin'],
} ->
exec { 'apt-update':
command => 'apt-get update',
path => ['/usr/bin/', '/bin'],
} ->
exec { 'accept-java-license':
command => '/bin/echo /usr/bin/debconf shared/accepted-oracle-license-v1-1 select true | sudo /usr/bin/debconf-set-selections;/bin/echo /usr/bin/debconf shared/accepted-oracle-license-v1-1 seen true | sudo /usr/bin/debconf-set-selections;',
} ->
package { 'oracle-java7-installer':
ensure => present,
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment