How can I accept the Lience agreement for steam prior to apt-get install?

As stated in the original question you can simply use the command line to set the required values before you attempt to install Steam.

echo steam steam/question select "I AGREE" | sudo debconf-set-selections
echo steam steam/license note '' | sudo debconf-set-selections

It is likely there was a bug in the package (packaging is notoriously hard if it isn't your primary responsibility) and later versions should now work and read the pre-accepted license from the debconf database. This means you shouldn't get prompted.

sudo apt-get install steam

The typical format is below:

echo package package/key {boolean,string} {true, some string} | sudo debconf-set-selections
sudo apt-get install package

The helpful Q&A for this was https://unix.stackexchange.com/a/106553


Using your research and the link provided in the comments of your post, I figured this out. As of 15.04 (on 2015-09-24), the steam package in the Ubuntu repositories is still 1.0.0.48, but you need 1.0.0.50 to properly read the debconf settings.

I found that the steam.deb you can download from the Steam downloads page is 1.0.0.50, so if you install from this file, with the debconf settings, it should work.

I use saltstack, and here is my working state for steam:

steam:
  debconf.set:
    - data:
        steam/question: {'type': 'select', 'value': 'I AGREE'}
        steam/license: {'type': 'note', 'value': ''}
  pkg.installed:
    - sources:
      - steam-launcher: https://steamcdn-a.akamaihd.net/client/installer/steam.deb
    - require:
      - debconf: steam

5 years late, but I have the following ansible tasks that seems to work with Debian 9 and 10, tested with molecule and docker.

Provided you have already setup a device with x11 and mesa/preferred graphics drivers, something like this could work:

- name: Add i386 arch
  command: dpkg --add-architecture i386

- name: accept steam license
  debconf:
    name: "steam"
    question: "steam/question"
    value: "I AGREE"
    vtype: "select"

- name: Install steam
  apt:
   name: steam
   update_cache: yes
   state: present