Skip to content

Instantly share code, notes, and snippets.

@jlaska
Created July 12, 2016 19:18
Show Gist options
  • Save jlaska/e2fd5d7ec39e04bcf42f807514db9411 to your computer and use it in GitHub Desktop.
Save jlaska/e2fd5d7ec39e04bcf42f807514db9411 to your computer and use it in GitHub Desktop.
- hosts: all
vars:
repo_file: '/etc/apt/sources.list.d/ppa_jal233_proot_trusty.list'
tasks:
- name: 'Remove repo file'
file:
path: '{{ repo_file }}'
state: 'absent'
- name: 'Install apt repo with mode:0400'
apt_repository:
repo: 'ppa:jal233/proot'
mode: '0400'
- name: 'stat the repo_file'
stat:
path: '{{ repo_file }}'
register: before_stat
- name: 'Install apt repo with mode:0644 perms'
apt_repository:
repo: 'ppa:jal233/proot'
mode: '0400'
register: result
- name: 'stat the repo_file'
stat:
path: '{{ repo_file }}'
register: after_stat
- assert:
that:
- "'{{ before_stat.stat.mode }}' == '0400'"
- "'{{ after_stat.stat.mode }}' == '0644'"
- '{{ result.changed }}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment