diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7788bf8d81d5d35add035d34f666c6a80af5fae3..1de57c8fc83abbe4767123483d6eddd50d18c694 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,13 +1,18 @@ - repo: https://github.com/pre-commit/pre-commit-hooks - sha: 6dfcb89af3c9b4d172cc2e5a8a2fa0f54615a338 + sha: 7539d8bd1a00a3c1bfd34cdb606d3a6372e83469 hooks: - id: check-added-large-files - id: check-json - id: check-xml - id: check-yaml - id: check-merge-conflict -- repo: https://www.shore.co.il/git/ansible-pre-commit/ - sha: 94b506c144d4e22ebc1deef637a818db13bcaca5 + - id: check-symlinks +- repo: https://www.shore.co.il/git/ansible-pre-commit + sha: 0fadd691465b97db8992cfc66650f630e433324b hooks: - - id: ansible-pre-commit - files: (pkgs|dropbox|skype|desktop)\.yml$ + - id: ansible-syntax-check + files: \.yml$ +- repo: https://github.com/willthames/ansible-lint + sha: 959ab0f525e9abb19cf75f34381015cf33695f61 + hooks: + - id: ansible-lint diff --git a/desktop.yml b/desktop.yml index 9db1ee5170e88953411de61c444b6da3f6f3b97f..13e92dd2050292dc62f3a4870341d00e1eeee5c4 100644 --- a/desktop.yml +++ b/desktop.yml @@ -10,7 +10,8 @@ command: /usr/sbin/update-grub tasks: - - assert: + - name: Assertions + assert: that: - ansible_pkg_mgr == 'apt' diff --git a/dropbox.yml b/dropbox.yml index 90f030bcb339cc0beed3650caea07c8401b38f21..67662b5a81dd369107006fad32c1f650030764da 100644 --- a/dropbox.yml +++ b/dropbox.yml @@ -2,12 +2,13 @@ - hosts: all become: no tasks: - - assert: + - name: Assertions + assert: that: - ansible_architecture == 'x86_64' - name: Verify that Python is installed - shell: python --version + command: python --version changed_when: False - name: Download Dropbox tarball @@ -18,11 +19,11 @@ register: download_dropbox_tarball - name: Unpack Dropbox tarball - when: '{{ download_dropbox_tarball.changed }}' unarchive: copy: no dest: '{{ ansible_user_dir }}/' src: '{{ ansible_user_dir }}/Downloads/dropbox-lnx.x86_64.tar.gz' + creates: '{{ ansible_user_dir }}/.dropbox-dist/dropboxd' - name: Get Python Dropbox startup script get_url: diff --git a/pkgs.yml b/pkgs.yml index 6865dbe67145ac4caed71795f3e788efc305e8fb..27b6f7f2c62dbdbd69c42f6fa76d017608845bf9 100644 --- a/pkgs.yml +++ b/pkgs.yml @@ -120,7 +120,7 @@ - vim-nox - vinagre - virtualbox-qt - - xdg-user-dirs + - xdg-user-dirs go: - github.com/giantswarm/semver-bump - github.com/nishanths/license @@ -147,7 +147,8 @@ - rustfmt tasks: - - assert: + - name: Assertions + assert: that: - ansible_pkg_mgr == 'apt' @@ -157,7 +158,7 @@ become_user: root apt: name: '{{ apt|join(" ") }}' - state: latest + state: present purge: yes force: yes update_cache: yes @@ -165,7 +166,7 @@ - name: go get when: go is iterable - shell: 'go get -u {{ go|join(" ") }}' + command: 'go get -u {{ go|join(" ") }}' - name: gem install when: gem is iterable @@ -173,7 +174,7 @@ become_user: root gem: name: '{{ gem|join(" ") }}' - state: latest + state: present - name: npm install when: npm is iterable @@ -182,7 +183,7 @@ npm: global: yes name: '{{ npm|join(" ") }}' - state: latest + state: present - name: pip install when: pip is iterable @@ -190,7 +191,7 @@ become_user: root pip: name: '{{ pip|join(" ") }}' - state: latest + state: present - name: pip3 install when: pip3 is iterable @@ -198,7 +199,7 @@ become_user: root pip: name: '{{ pip3|join(" ") }}' - state: latest + state: present executable: pip3 - name: cargo install diff --git a/skype.yml b/skype.yml index ba0bb2ea2560aea055bf305cbc43863b13cf5e56..a2b0a66591b192b7d58199db272a361733a02da1 100644 --- a/skype.yml +++ b/skype.yml @@ -3,7 +3,8 @@ become: yes become_user: root tasks: - - assert: + - name: Assertions + assert: that: - ansible_architecture in [ 'x86_64', 'x86' ] - ansible_pkg_mgr == 'apt' diff --git a/templates/landrush.j2 b/templates/landrush.j2 new file mode 100644 index 0000000000000000000000000000000000000000..f3da35745049e73b7632fc687090944094e95689 --- /dev/null +++ b/templates/landrush.j2 @@ -0,0 +1 @@ +server=/vagrant/127.0.0.1#10053 diff --git a/templates/landrush.service.j2 b/templates/landrush.service.j2 new file mode 100644 index 0000000000000000000000000000000000000000..42d7eb8f3d1b34539923cbbf99a3910a3f20d120 --- /dev/null +++ b/templates/landrush.service.j2 @@ -0,0 +1,7 @@ +[Unit] +Description=Vagrant Landrsuh DNS server +AssertPathIsDirectory=/home/{{ ansible_env.SUDO_USER }} + +[Service] +Type=forking +ExecStart=/usr/bin/vagrant landrush start diff --git a/workstation.yml b/workstation.yml index e4c9fc581c1f693dd995920e9fca8e8accf0d588..928c79a0b8bf81ad7ef96995f3407af0369c5255 100644 --- a/workstation.yml +++ b/workstation.yml @@ -16,7 +16,8 @@ state: restarted tasks: - - assert: + - name: Assertions + assert: that: - ansible_pkg_mgr == 'apt' @@ -73,7 +74,7 @@ - Restart Docker - name: Get Docker graph directory mountpoint - shell: df {{ docker_graph_directory }} + command: df {{ docker_graph_directory }} register: docker_graph_df changed_when: False