Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Engineering for Failure

Engineering for Failure

In this talk, Chris Grigor and I look at how we improved our way of working with Ansible at IceMobile.

We look at our principles of "Engineering for Failure" and share our insights with the community.

This version of the talk was given at CfgMgmtCamp in February 2016.

Kerim Satirli

February 01, 2016
Tweet

More Decks by Kerim Satirli

Other Decks in Programming

Transcript

  1. - name: Check to see if pip is already installed

    command: "pip --version" ignore_errors: true changed_when: false register: pip_is_installed - name: Get pip get_url: url=https://bootstrap.pypa.io/get-pip.py dest=/home/ec2-user when: pip_is_installed.rc != 0 - name: install pip command: "python /home/ec2-user/get-pip.py" sudo: yes when: pip_is_installed.rc != 0 - name: delete get-pip.py file: state=absent path=~/get-pip.py when: pip_is_installed.rc != 0 - name: Installing docker-py for ansible pip: name=docker-py version=1.1.0 #executable=/usr/local/bin/pip sudo: yes - name: Adding Docker Hub robot login copy: src=../resources/dockercfg dest=/home/ec2-user/.dockercfg owner=ec2-user
  2. - name: Check to see if pip is already installed

    command: "pip --version" ignore_errors: true changed_when: false register: pip_is_installed - name: Get pip get_url: url=https://bootstrap.pypa.io/get-pip.py dest=/home/ec2-user when: pip_is_installed.rc != 0 - name: install pip command: "python /home/ec2-user/get-pip.py" sudo: yes when: pip_is_installed.rc != 0 - name: delete get-pip.py file: state=absent path=~/get-pip.py when: pip_is_installed.rc != 0 - name: Installing docker-py for ansible pip: name=docker-py version=1.1.0 #executable=/usr/local/bin/pip sudo: yes - name: Adding Docker Hub robot login copy: src=../resources/dockercfg dest=/home/ec2-user/.dockercfg owner=ec2-user IT WORKS!
  3. - include: ./notify-datadog.yml vars: event_type: error api_key: "{{ datadog.api_key }}"

    event_title: "Checksum mismatch for {{ name }} v{{ version }}" event_text: "{{ fetch_application_package.msg }}" event_priority: "{{ datadog.priority }}" event_tags: "app:{{ name | lower }}, \ version:{{ version }}, \ type:checksum-mismatch" when: fetch_application_package.failed is defined tags: - fhp_datadog_checksum
  4. - # validate config file include: ../../roles/validate-file/tasks/main.yml vars: validation_file: "{{

    config.dirs.etc }}/{{ config.file }}" validation_type: json validation_result_var: consulconfig_validation tags: - pc_validate_configfile
  5. --- - shell: "cat {{ validation_file }}" register: res -

    set_fact: "{{ vldtn_res_var | default(vldtn_res)}}": \ "{{ res.stdout | from_json }}" when: validation_type == "json" - set_fact: "{{ vldtn_res_var | default(vldtn_res)}}": \ "{{ res.stdout | from_yaml }}" when: validation_type == "yaml"