Closure of octo.sh is scheduled for May 1st 2019. Please migrate as soon as possible. Repositories backups will be available upon request, after the server is offline. Contact: gitlab@octo.im

...
 
Commits (7)
......@@ -52,3 +52,27 @@ f28:
&& (echo 'Idempotence test: pass' && exit 0)
|| (echo 'Idempotence test: fail' && exit 1)
- 'docker rm -f "$(cat ${container_id})"'
f29:
stage: test
tags:
- docker
variables:
GIT_STRATEGY: clone
distro: fedora
distro_version: 29
DOCKER_HOST: "tcp://docker:2375"
before_script:
- 'docker pull "quay.io/sheogorath/ansible-ci-images:${distro}-${distro_version}"'
- 'sed -i "s/True/False/" ansible.cfg'
script:
- container_id=$(mktemp)
- 'docker run --detach --privileged -v /sys/fs/cgroup:/sys/fs/cgroup:ro --volume="${PWD}":/etc/ansible/:ro "quay.io/sheogorath/ansible-ci-images:${distro}-${distro_version}" > "${container_id}"'
- 'docker exec "$(cat ${container_id})" env ANSIBLE_FORCE_COLOR=1 ansible-playbook -v /etc/ansible/full.yml --syntax-check'
- 'docker exec "$(cat ${container_id})" env ANSIBLE_FORCE_COLOR=1 ansible-playbook -v /etc/ansible/full.yml'
- docker exec "$(cat ${container_id})" env ANSIBLE_FORCE_COLOR=1 ansible-playbook -v /etc/ansible/full.yml | tee ansible.log
- >
grep -q 'changed=0.*failed=0' ansible.log
&& (echo 'Idempotence test: pass' && exit 0)
|| (echo 'Idempotence test: fail' && exit 1)
- 'docker rm -f "$(cat ${container_id})"'
......@@ -12,10 +12,12 @@ Clone the repository, and use `ansible-playbook` to run it.
Optionally in order to use the `optional` roles not included in the default `clients.yml` playbook make a copy of it with the filename `custom.yml`, which is part of `.gitignore` by default.
Also install `Python2`, since it is required by ansible and e.g. Fedora decided to not ship it anymore since F29.
### Fedora
```bash
sudo dnf install git ansible
sudo dnf install git ansible python
git clone https://octo.sh/ansible-client/ansible-client.git
cd ansible-client
ansible-playbook clients.yml
......
---
- hosts: clients
vars:
- hugo_sass: yes
- hardware_thinkpad_x1_carbon_6th_cpu_throttling_fix: yes
roles:
- sys-upgrade
- rpmfusion
......@@ -19,8 +22,3 @@
- adapta-gtk-theme
- freeopcua
- hugo
- hosts: clients
vars:
- hugo_sass: yes
roles:
- hugo
\ No newline at end of file
......@@ -12,7 +12,7 @@
- copr
when:
- ansible_distribution == "Fedora"
- ansible_distribution_major_version > 26
- ansible_distribution_major_version is version('26', '>')
become: true
- name: Install Adapta-GTK-Theme Common Package
......
......@@ -8,5 +8,5 @@
enabled: yes
when:
- ansible_distribution == "Fedora"
- ansible_distribution_major_version > 21
- ansible_distribution_major_version is version('21', '>')
become: true
......@@ -3,11 +3,8 @@
- name: Install default packages
dnf:
name: "{{ item }}"
name: "{{ packages | union(extended_packages | default([])) | map(attribute='dnf') | list }}"
state: present
with_items:
- "{{ packages | map(attribute='dnf') | list }}"
- "{{ extend_packages | map(attribute='dnf') | list }}"
tags:
- dnf
- download
......
......@@ -3,8 +3,6 @@
- name: Install default packages
dnf:
name: "{{ item }}"
name: "{{ packages | map(attribute='apt') | list }}"
state: present
with_items:
- "{{ packages | map(attribute='apt') | list }}"
become: true
......@@ -13,7 +13,7 @@
- copr
when:
- ansible_distribution == "Fedora"
- ansible_distribution_major_version > 26
- ansible_distribution_major_version is version('26', '>')
become: true
- name: Install discord
......
......@@ -17,6 +17,6 @@
tags:
- flatpak
when:
- ansible_version.major >= 2
- ansible_version.minor >= 6
- ansible_version.major is version('2', '>=')
- ansible_version.minor is version('6', '>=')
become: true
---
# defaults file for gitkraken
gitkraken_download_path: "/tmp/gitkraken-amd64.tar.gz"
gitkraken_install_path: "/opt/GitKraken"
gitkraken_download_url: "https://release.gitkraken.com/linux/gitkraken-amd64.tar.gz"
# -*- coding: UTF-8 -*-
# This example is contributed by Martin Enlund
# Example modified for GitKraken
# Shortcuts Provider was inspired by captain nemo extension
from gettext import gettext, textdomain
from subprocess import PIPE, call
from urllib import unquote
from urlparse import urlparse
from gi import require_version
require_version('Gtk', '3.0')
require_version('Nautilus', '3.0')
from gi.repository import Gio, GObject, Gtk, Nautilus
COMMAND = "gitkraken"
KEYBINDINGS = "com.axosoft.GitKraken.Keybindings"
GSETTINGS_OPEN_TERMINAL = "nautilus-open"
textdomain("gitkraken")
_ = gettext
def run(file_):
if file_.is_directory():
filename = Gio.File.new_for_uri(file_.get_uri()).get_path()
if filename:
call('{0} --args -p "{1}" &'.format(COMMAND, filename), shell=True)
else:
call("{0} &".format(COMMAND), shell=True)
class OpenGitKrakenShortcutProvider(GObject.GObject,
Nautilus.LocationWidgetProvider):
def __init__(self):
source = Gio.SettingsSchemaSource.get_default()
if source.lookup(KEYBINDINGS, True):
self._gsettings = Gio.Settings.new(KEYBINDINGS)
self._gsettings.connect("changed", self._bind_shortcut)
self._create_accel_group()
self._window = None
self._uri = None
def _create_accel_group(self):
self._accel_group = Gtk.AccelGroup()
shortcut = self._gsettings.get_string(GSETTINGS_OPEN_TERMINAL)
key, mod = Gtk.accelerator_parse(shortcut)
self._accel_group.connect(key, mod, Gtk.AccelFlags.VISIBLE,
self._open_terminal)
def _bind_shortcut(self, gsettings, key):
if key == GSETTINGS_OPEN_TERMINAL:
self._accel_group.disconnect(self._open_terminal)
self._create_accel_group()
def _open_terminal(self, *args):
filename = unquote(self._uri[7:])
run(filename)
def get_widget(self, uri, window):
self._uri = uri
if self._window:
self._window.remove_accel_group(self._accel_group)
if self._gsettings:
window.add_accel_group(self._accel_group)
self._window = window
return None
class OpenGitKrakenExtension(GObject.GObject, Nautilus.MenuProvider):
def _open_terminal(self, file_):
run(file_)
def _menu_activate_cb(self, menu, file_):
self._open_terminal(file_)
def _menu_background_activate_cb(self, menu, file_):
self._open_terminal(file_)
def get_file_items(self, window, files):
if len(files) != 1:
return
items = []
file_ = files[0]
print("Handling file: ", file_.get_uri())
print("file scheme: ", file_.get_uri_scheme())
if file_.is_directory():
filename = file_.get_name().decode('utf-8')
item = Nautilus.MenuItem(name='NautilusPython::open_file_item',
label=_(u'Open In GitKraken'),
tip=_(u'Open GitKraken In {}').format(filename))
item.connect('activate', self._menu_activate_cb, file_)
items.append(item)
return items
def get_background_items(self, window, file_):
items = []
item = Nautilus.MenuItem(name='NautilusPython::open_bg_file_item',
label=_(u'Open GitKraken Here'),
tip=_(u'Open GitKraken In This Directory'))
item.connect('activate', self._menu_background_activate_cb, file_)
items.append(item)
return items
---
# handlers file for gitkraken
- name: Update icon directory timestamp
file:
path: "/usr/share/icons/hicolor"
state: touch
tags:
- gitkraken
- gtk
become: true
- name: Update GTK icon cache
tags:
- gitkraken
- gtk
command: "gtk-update-icon-cache"
---
# handlers file for gitkraken
- name: refresh GTK icon cache
import_tasks: "clear-gtk-cache.yml"
......@@ -19,4 +19,5 @@ galaxy_info:
- all
galaxy_tags: []
dependencies: []
dependencies:
- flathub
---
# Fedora setup for GitKraken
- name: Detect broken setup
stat:
path: "{{ gitkraken_install_path }}/gitkraken"
tags:
- gitkraken
register: gitkraken_broken_setup
- name: Remove broken setup
file:
path: "{{ gitkraken_install_path }}"
state: absent
tags:
- gitkraken
become: true
when: gitkraken_broken_setup.stat.isdir is defined and gitkraken_broken_setup.stat.isdir
- name: Check that GitKraken is installed
stat:
path: "{{ gitkraken_install_path }}"
tags:
- gitkraken
register: gitkraken_dir
- name: Download GitKraken
get_url:
url: "{{ gitkraken_download_url }}"
dest: "{{ gitkraken_download_path }}"
tags:
- download
- gitkraken
when: gitkraken_dir.stat.exists == False
- name: Unpack GitKraken
unarchive:
src: "{{ gitkraken_download_path }}"
dest: "/tmp/"
remote_src: yes
tags:
- gitkraken
- unarchive
register: unpacked_gitkraken
when: gitkraken_dir.stat.exists == False
- name: Install GitKraken
command: "mv /tmp/gitkraken {{ gitkraken_install_path }}"
args:
creates: "{{ gitkraken_install_path }}"
tags:
- gitkraken
become: yes
when: gitkraken_dir.stat.exists == False
- name: Clean up
file:
path: /tmp/gitkraken
state: absent
tags:
- gitkraken
when: unpacked_gitkraken is succeeded
- name: Create desktop entry
template:
src: gitkraken.desktop
dest: /usr/share/applications/gitkraken.desktop
tags:
- gitkraken
- desktop
become: true
- name: Install desktop icon
copy:
src: gitkraken.png
dest: /usr/share/icons/hicolor/512x512/apps/gitkraken.png
tags:
- gitkraken
- gtk
- icons
- desktop
become: true
notify: "refresh GTK icon cache"
- name: Install GitKraken to path
file:
state: link
src: "{{ gitkraken_install_path }}/gitkraken"
dest: "/usr/local/bin/gitkraken"
tags:
- gitkraken
- path
become: true
- name: Install Nautilus-Extension
copy:
src: open-gitkraken.py
dest: /usr/share/nautilus-python/extensions/open-gitkraken.py
tags:
- gitkraken
- python
- nautilus
- nautilus-python
- nautlius-python-extension
become: true
notify: "Nautilus python extension notification"
- name: Increase inotify count
sysctl:
name: fs.inotify.max_user_watches
value: 524288
sysctl_set: yes
state: present
reload: yes
become: true
- import_tasks: remove.yml
- import_tasks: flatpak.yml
---
- name: Install GitKraken from FlatHub
flatpak:
name: com.axosoft.GitKraken
state: present
remote: flathub
become: true
---
- name: Remove legacy setup
file:
state: absent
path: "{{ gitkraken_install_path }}"
become: true
......@@ -3,10 +3,8 @@
- name: Install gnome enhancements
dnf:
name: "{{ item }}"
name: "{{ packages | map(attribute='dnf') | list }}"
state: present
with_items:
- "{{ packages | map(attribute='dnf') | list }}"
tags:
- dnf
- download
......
......@@ -3,8 +3,6 @@
- name: Install gnome enhancements
dnf:
name: "{{ item }}"
name: "{{ packages | map(attribute='apt') | list }}"
state: present
with_items:
- "{{ packages | map(attribute='apt') | list }}"
become: true
......@@ -7,7 +7,7 @@
state: present
when:
- ansible_distribution == "Fedora"
- ansible_distribution_major_version > 21
- ansible_distribution_major_version is version('21', '>')
- ansible_selinux_python_present == false
become: true
......
---
# tasks file for lenovo carbon 6th gen patch cpu-throttling
- name: Install msr-tools
dnf:
name: msr-tools
state: present
tags:
- lenovo
- carbon
- 6th
- patches
- dnf
- packages
become: true
- block:
- name: Install msr-tools
dnf:
name: msr-tools
state: present
tags:
- lenovo
- carbon
- 6th
- patches
- dnf
- packages
become: true
- name: Install CPU-Throttling patch script
copy:
src: cpu-throttling.sh
dest: /usr/local/bin/cpu-throttling.sh
mode: 0755
register: cpu_throttling_script
tags:
- lenovo
- carbon
- 6th
- patches
become: true
- name: Install CPU-Throttling patch script
copy:
src: cpu-throttling.sh
dest: /usr/local/bin/cpu-throttling.sh
mode: 0755
register: cpu_throttling_script
tags:
- lenovo
- carbon
- 6th
- patches
become: true
- name: Install CPU-Throttling systemd service
when: cpu_throttling_script is succeeded
copy:
src: cpu-throttling.service
dest: /etc/systemd/system/cpu-throttling.service
register: cpu_throttling_service
tags:
- lenovo
- carbon
- 6th
- patches
become: true
- name: Install CPU-Throttling systemd service
when: cpu_throttling_script is succeeded
copy:
src: cpu-throttling.service
dest: /etc/systemd/system/cpu-throttling.service
register: cpu_throttling_service
tags:
- lenovo
- carbon
- 6th
- patches
become: true
- name: Install CPU-throttling systemd timer
when: cpu_throttling_service is succeeded
copy:
src: cpu-throttling.timer
dest: /etc/systemd/system/cpu-throttling.timer
register: cpu_throttling_timer
tags:
- lenovo
- carbon
- 6th
- patches
become: true
- name: Install CPU-throttling systemd timer
when: cpu_throttling_service is succeeded
copy:
src: cpu-throttling.timer
dest: /etc/systemd/system/cpu-throttling.timer
register: cpu_throttling_timer
tags:
- lenovo
- carbon
- 6th
- patches
become: true
- name: Enable CPU-throttling systemd service
when: cpu_throttling_service is succeeded
systemd:
name: cpu-throttling.service
enabled: yes
state: started
daemon_reload: yes
become: true
notify: "Throttling patch restart notification"
- name: Enable CPU-throttling systemd service
when: cpu_throttling_service is succeeded
systemd:
name: cpu-throttling.service
enabled: yes
state: started
daemon_reload: yes
become: true
notify: "Throttling patch restart notification"
- name: Enable CPU-throttling systemd timer
when: cpu_throttling_timer is succeeded
systemd:
name: cpu-throttling.timer
enabled: yes
state: started
daemon_reload: yes
become: true
- name: Enable CPU-throttling systemd timer
when: cpu_throttling_timer is succeeded
systemd:
name: cpu-throttling.timer
enabled: yes
state: started
daemon_reload: yes
become: true
when:
- hardware_thinkpad_x1_carbon_6th_cpu_throttling_fix is defined
- hardware_thinkpad_x1_carbon_6th_cpu_throttling_fix
......@@ -14,7 +14,7 @@
- copr
when:
- ansible_distribution == "Fedora"
- ansible_distribution_major_version > 26
- ansible_distribution_major_version is version('26', '>')
become: true
- name: Import GPG key
......
......@@ -3,10 +3,8 @@
- name: Install nautilus packages
dnf:
name: "{{ item }}"
name: "{{ nautilus_packages | map(attribute='dnf') | list }}"
state: present
with_items:
- "{{ nautilus_packages | map(attribute='dnf') | list }}"
tags:
- nautilus
- dnf
......
......@@ -7,21 +7,20 @@
state: present
when:
- ansible_distribution == "Fedora"
- ansible_distribution_major_version > 21
- ansible_distribution_major_version is version('21', '>')
- ansible_selinux_python_present == false
become: true
- name: Install Nextcloud
dnf:
name: "{{ item }}"
name:
- nextcloud-client
- nextcloud-client-nautilus
state: present
when:
- ansible_distribution == "Fedora"
- ansible_distribution_major_version > 21
- ansible_distribution_major_version is version('21', '>')
become: true
with_items:
- nextcloud-client
- nextcloud-client-nautilus
- name: Preconfigure Nextcloud
template:
......
......@@ -13,7 +13,7 @@
- copr
when:
- ansible_distribution == "Fedora"
- ansible_distribution_major_version > 21
- ansible_distribution_major_version is version('21', '>')
become: true
- name: Install Riot
......