8
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

ansibleでoracle jdkをインストールする

Posted at

playbookはこんな感じ
ポイントは、ライセンスのaccept(逆に、それ以外はPPAからaptでインストールするから、何の苦もないだろうと言われるかも知れないけど、その通り)

yaml
- hosts: 127.0.0.1
  connection: local
  become: yes
  tasks:
      - apt_repository: repo='ppa:webupd8team/java'
#     - name: Autoaccept license for Java7
#      debconf: name='oracle-java7-installer' question='shared/accepted-oracle-license-v1-1' value='true' vtype='select'

    - name: Autoaccept license for Java8
      debconf: name='oracle-java8-installer' question='shared/accepted-oracle-license-v1-1' value='true' vtype='select'
    
    - name: Install Java
      apt: name={{item}} state=latest
      with_items:
        - oracle-java8-installer
        - ca-certificates
        - oracle-java8-set-default
8
8
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
8
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?