Auto accept license pkgin

133 views
Skip to first unread message

Paul Wolstenholme

unread,
Feb 7, 2014, 4:08:15 PM2/7/14
to ansible...@googlegroups.com
Are there any tricks to installing a package with a license acceptance requirement. I'm using pkgin to install sun-jre and it is failing. I was just wondering if anyone has any suggestions for auto-accepting the sun license agreement.

Cheers,
Paul

Erik Anderson

unread,
Feb 7, 2014, 4:12:35 PM2/7/14
to ansible...@googlegroups.com
On Fri, Feb 7, 2014 at 3:08 PM, Paul Wolstenholme <paul.wol...@cbc.ca> wrote:
I was just wondering if anyone has any suggestions for auto-accepting the sun license agreement.

If you're on ubuntu or debian, you just need to issue these commands before installing the package:

$ echo debconf shared/accepted-oracle-license-v1-1 select true | \
  sudo debconf-set-selections
$ echo debconf shared/accepted-oracle-license-v1-1 seen true | \
  sudo debconf-set-selections
-Erik

Brian Coca

unread,
Feb 7, 2014, 4:24:49 PM2/7/14
to ansible...@googlegroups.com
I'm assuming BSD, you probably have to add to the ACCEPTABLE_LICENSES variable (check BSD distro for where to do so). Adding it to environment: on your task might even work.

Erik Anderson

unread,
Feb 7, 2014, 4:26:30 PM2/7/14
to ansible...@googlegroups.com
On Fri, Feb 7, 2014 at 3:08 PM, Paul Wolstenholme <paul.wol...@cbc.ca> wrote:
I'm using pkgin

Missed that. Nevermind my email.

...perhaps it may be useful in the future for debian/ubuntu types. :)

Brian Coca

unread,
Feb 7, 2014, 4:28:45 PM2/7/14
to ansible...@googlegroups.com
@erik, I'm in last stages of getting a debconf module accepted, so I hope that even that won't be the case ;-)

Erik Anderson

unread,
Feb 7, 2014, 4:29:32 PM2/7/14
to ansible...@googlegroups.com
On Fri, Feb 7, 2014 at 3:28 PM, Brian Coca <bria...@gmail.com> wrote:
I'm in last stages of getting a debconf module accepted, so I hope that even that won't be the case ;-)

That is *great* news. Thanks for your work in it!

Paul Wolstenholme

unread,
Feb 7, 2014, 8:00:49 PM2/7/14
to ansible...@googlegroups.com
Thanks everyone. I'm running pkgin on Smartos. I added the ACCEPTABLE_LICENSES (ACCEPTABLE_LICENSES=            sun-jre) to the mk.conf file in /opt/local/share/mk folder. Works great. 

But I think setting an environment variable in the ansible is easier. In my case, I set it in the role vars file.

license_env:
  ACCEPTABLE_LICENSES: 'sun-jre6'

And then in the task:

- name: Install Java
  pkgin: name=sun-jre6 state=present
  environment: license_env
  tags: logstash









Thanks,
Paul


On Fri, Feb 7, 2014 at 1:24 PM, Brian Coca <bria...@gmail.com> wrote:
I'm assuming BSD, you probably have to add to the ACCEPTABLE_LICENSES variable (check BSD distro for where to do so). Adding it to environment: on your task might even work.

--
You received this message because you are subscribed to a topic in the Google Groups "Ansible Project" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ansible-project/uowowhBY83c/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--

Paul Wolstenholme
CBC Music - System Administrator
CBC  Vancouver
604.662.6632
Reply all
Reply to author
Forward
0 new messages