Can I automatically accept MS SQL license terms while installing the yum package?

- name: install mssql-server repo (CentOS, RedHat)
  get_url:
    url: "{{ centos_repo_url }}"
    dest: /etc/yum.repos.d/mssql-server.repo
  when: ansible_distribution in ['CentOS', 'RedHat']

- name: install mssql-server repo (Ubuntu)
  get_url:
    url: "{{ ubuntu_repo_url }}"
    dest: /etc/apt/sources.list.d/mssql-server.list
  when: ansible_distribution == 'Ubuntu'

- name: refresh apt-get cache for server repo (Ubuntu)
  command: apt-get update
  when: ansible_distribution == 'Ubuntu'

- name: install mssql-server package
  package:
    name: mssql-server
    state: latest

- name: install mssql-tools package
  package:
    name: mssql-tools
    state: latest
  environment:
    ACCEPT_EULA: 'y'

A sample playbook for installing and configuring SQL Server (along with creating a Pacemaker-managed Availability Group) is available at https://github.com/Microsoft/sql-server-samples/tree/master/samples/features/high%20availability/Linux/Ansible%20Playbook


This should work in terms of EULA for Tools

sudo ACCEPT_EULA=Y apt-get install -y mssql-tools unixodbc-dev

As far as unattended install, you can specify environment variables or command line options for most things during setup. Take a look at Sample: Unattended SQL Server installation script for Red Hat Enterprise Linux.

NOTE: I noticed the repo in the links is still pointing to the older pre-RTM repo. Please use these repos while we correct them.