Browse Source

Initial role commit

Vladimir Karnushin 1 month ago
parent
commit
4679e99579
5 changed files with 48 additions and 0 deletions
  1. 10 0
      defaults/main.yml
  2. 3 0
      meta/main.yml
  3. 13 0
      tasks/bash.yml
  4. 7 0
      tasks/main.yml
  5. 15 0
      tasks/workspace.yml

+ 10 - 0
defaults/main.yml

@@ -0,0 +1,10 @@
+---
+
+user_directory: /root
+workspace_directory: ws
+
+workspace_packages: []
+development_packages: []
+
+bashrc: https://sourceforge.net/projects/ultimate-bashrc/files/_bashrc/download
+bashrc_help: https://sourceforge.net/projects/ultimate-bashrc/files/_bashrc_help/download

+ 3 - 0
meta/main.yml

@@ -0,0 +1,3 @@
+---
+
+dependencies: []

+ 13 - 0
tasks/bash.yml

@@ -0,0 +1,13 @@
+---
+
+- name: Download .bashrc file
+  ansible.builtin.get_url:
+    url: "{{ bashrc }}"
+    dest: "{{ user_directory }}/.bashrc"
+    force: true
+
+- name: Download .bashrc help file
+  ansible.builtin.get_url:
+    url: "{{ bashrc_help }}"
+    dest: "{{ user_directory }}/.bashrc_help"
+    force: true

+ 7 - 0
tasks/main.yml

@@ -0,0 +1,7 @@
+---
+
+- name: Setup workspace
+  ansible.builtin.include_tasks: workspace.yml
+
+- name: Setup bash
+  ansible.builtin.include_tasks: bash.yml

+ 15 - 0
tasks/workspace.yml

@@ -0,0 +1,15 @@
+---
+
+tasks:
+
+  - name: Create workspace directory if it does not exist
+    ansible.builtin.file:
+      path: "{{ user_directory }}/{{ workspace_directory }}"
+      state: directory
+      mode: '0755'
+
+  - name: Install workspace and development packages
+    ansible.builtin.package:
+      name: "{{ item }}"
+      state: present
+    loop: "{{ workspace_packages + development_packages }}"