Skip to content
This repository has been archived by the owner on Jun 19, 2023. It is now read-only.

Commit

Permalink
style(ANSIBLE-LINT): enforce fqcn
Browse files Browse the repository at this point in the history
  • Loading branch information
niall-byrne committed Feb 17, 2023
1 parent f55fd42 commit 77697fc
Show file tree
Hide file tree
Showing 11 changed files with 31 additions and 33 deletions.
6 changes: 3 additions & 3 deletions molecule/common/tasks/files.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
---
- name: Check the homeshick binary was installed
stat:
ansible.builtin.stat:
path: "{{ homeshick_user_home }}/.homesick/repos/homeshick"
register: homeshick_install

- name: Check the user dotfiles were installed
stat:
ansible.builtin.stat:
path: "{{ homeshick_user_home }}/.homesick/repos/{{ homeshick_dotfiles_repo | lower | basename | replace('.git', '') }}"
register: dotfiles_install

- name: Check the user .bashrc was installed
stat:
ansible.builtin.stat:
path: "{{ homeshick_user_home }}/.bashrc"
register: bashrc_symlink
2 changes: 1 addition & 1 deletion molecule/no_dotfiles/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
tasks:

- name: Load Scenario Variables
include_vars: vars/main.yml
ansible.builtin.include_vars: vars/main.yml

- name: "Include osx_provisioner.homeshick"
ansible.builtin.include_role:
Expand Down
6 changes: 3 additions & 3 deletions molecule/no_dotfiles/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
tasks:

- name: Load Scenario Variables
include_vars: vars/main.yml
ansible.builtin.include_vars: vars/main.yml

- name: Check File System Content
include_tasks: "../common/tasks/files.yml"
ansible.builtin.include_tasks: "../common/tasks/files.yml"

- name: Assert homeshick repository was installed
assert:
ansible.builtin.assert:
that:
- homeshick_install.stat.exists
- homeshick_install.stat.pw_name == homeshick_user
Expand Down
2 changes: 1 addition & 1 deletion molecule/with_dotfiles/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
tasks:

- name: Load Scenario Variables
include_vars: vars/main.yml
ansible.builtin.include_vars: vars/main.yml

- name: "Include osx_provisioner.homeshick"
ansible.builtin.include_role:
Expand Down
12 changes: 7 additions & 5 deletions molecule/with_dotfiles/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,27 @@
tasks:

- name: Load Scenario Variables
include_vars: vars/main.yml
ansible.builtin.include_vars: vars/main.yml

- name: Check File System Content
include_tasks: "../common/tasks/files.yml"
ansible.builtin.include_tasks: "../common/tasks/files.yml"

- name: Assert homeshick repository was installed
assert:
ansible.builtin.assert:
that:
- homeshick_install.stat.exists
- homeshick_install.stat.pw_name == homeshick_user
msg: "Homeshick repository must exist"

- name: Assert the user dotfiles were installed
assert:
ansible.builtin.assert:
that:
- dotfiles_install.stat.exists
- dotfiles_install.stat.pw_name == homeshick_user
msg: "Dotfiles repository must exist"

- name: Assert the user .bashrc was NOT symlinked (existing file)
assert:
ansible.builtin.assert:
that:
- not bashrc_symlink.stat.islnk
- bashrc_symlink.stat.readable
Expand Down
2 changes: 1 addition & 1 deletion molecule/with_dotfiles_force/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
tasks:

- name: Load Scenario Variables
include_vars: vars/main.yml
ansible.builtin.include_vars: vars/main.yml

- name: "Include osx_provisioner.homeshick"
ansible.builtin.include_role:
Expand Down
12 changes: 7 additions & 5 deletions molecule/with_dotfiles_force/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,27 @@
tasks:

- name: Load Scenario Variables
include_vars: vars/main.yml
ansible.builtin.include_vars: vars/main.yml

- name: Check File System Content
include_tasks: "../common/tasks/files.yml"
ansible.builtin.include_tasks: "../common/tasks/files.yml"

- name: Assert homeshick repository was installed
assert:
ansible.builtin.assert:
that:
- homeshick_install.stat.exists
- homeshick_install.stat.pw_name == homeshick_user
msg: "Homeshick repository must exist"

- name: Assert the user dotfiles were installed
assert:
ansible.builtin.assert:
that:
- dotfiles_install.stat.exists
- dotfiles_install.stat.pw_name == homeshick_user
msg: "Dotfiles repository must exist"

- name: Assert the user .bashrc was symlinked, and is readable
assert:
ansible.builtin.assert:
that:
- bashrc_symlink.stat.islnk
- bashrc_symlink.stat.readable
Expand Down
2 changes: 1 addition & 1 deletion requirements.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
collections:
collections: []
roles:
- src: elliotweiser.osx-command-line-tools
version: 2.3.0
13 changes: 7 additions & 6 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# tasks file for homeshick

- name: Check for Homeshick Install
stat:
ansible.builtin.stat:
path: "{{ homeshick_user_home }}/.homesick/repos/homeshick"
register: homeshick_stat_result
tags:
Expand All @@ -11,7 +11,7 @@
- name: Clone Homeshick
become: true
become_user: "{{ homeshick_user }}"
git:
ansible.builtin.git:
repo: https://github.com/andsens/homeshick.git
dest: "{{ homeshick_user_home }}/.homesick/repos/homeshick"
version: "{{ homeshick_version }}"
Expand All @@ -20,22 +20,23 @@
- homeshick

- name: Check if the user dotfiles were already installed
stat:
ansible.builtin.stat:
path: "{{ homeshick_user_home }}/.homesick/repos/{{ homeshick_dotfiles_repo | lower | basename | replace('.git', '') }}"
register: user_dot_files

- name: Install User Dotfiles
become: true
become_user: "{{ homeshick_user }}"
command: "{{ homeshick_user_home }}/.homesick/repos/homeshick/bin/homeshick clone {{ homeshick_dotfiles_repo }}"
ansible.builtin.command: "{{ homeshick_user_home }}/.homesick/repos/homeshick/bin/homeshick clone {{ homeshick_dotfiles_repo }}"
changed_when: not user_dot_files.stat.exists and homeshick_dotfiles_repo
when: not user_dot_files.stat.exists and homeshick_dotfiles_repo
tags:
- homeshick

- name: Link Install Dotfiles (Force)
become: true
become_user: "{{ homeshick_user }}"
command: "{{ homeshick_user_home }}/.homesick/repos/homeshick/bin/homeshick link -vf {{ homeshick_dotfiles_repo | lower | basename | replace('.git', '') }}"
ansible.builtin.command: "{{ homeshick_user_home }}/.homesick/repos/homeshick/bin/homeshick link -vf {{ homeshick_dotfiles_repo | lower | basename | replace('.git', '') }}"
register: homeshick_install_command
changed_when: "'symlink' in homeshick_install_command.stdout"
when: homeshick_dotfiles_repo and homeshick_force
Expand All @@ -45,7 +46,7 @@
- name: Link Install Dotfiles (Without Force)
become: true
become_user: "{{ homeshick_user }}"
command: "{{ homeshick_user_home }}/.homesick/repos/homeshick/bin/homeshick link -v {{ homeshick_dotfiles_repo | lower | basename | replace('.git', '') }}"
ansible.builtin.command: "{{ homeshick_user_home }}/.homesick/repos/homeshick/bin/homeshick link -v {{ homeshick_dotfiles_repo | lower | basename | replace('.git', '') }}"
register: homeshick_install_command
changed_when: "'symlink' in homeshick_install_command.stdout"
when: homeshick_dotfiles_repo and not homeshick_force
Expand Down
2 changes: 0 additions & 2 deletions tests/inventory

This file was deleted.

5 changes: 0 additions & 5 deletions tests/test.yml

This file was deleted.

0 comments on commit 77697fc

Please sign in to comment.