Skip to content

Instantly share code, notes, and snippets.

@sharvit
sharvit / katello_test_error.md
Last active September 16, 2018 15:40
Ketello test error
[vagrant@centos7-luna-devel foreman]$ bundle exec rake test:katello TEST=../katello/test/models/product_content_test.rb
WARNING: File locale/es/LC_MESSAGES/foreman_openscap.mo outdated, regenerate with 'make all-mo'
WARNING: File locale/sv_SE/LC_MESSAGES/foreman_openscap.mo outdated, regenerate with 'make all-mo'
/home/vagrant/foreman/lib/foreman.rb:8: warning: already initialized constant Foreman::UUID_REGEXP
/home/vagrant/foreman/lib/foreman.rb:8: warning: previous definition of UUID_REGEXP was here
The Apipie cache is turned off. Enable it and run apipie:cache rake task to speed up API calls.
rake aborted!
ArgumentError: A class was passed to `:class_name` but we are expecting a string.
/home/vagrant/.rvm/gems/ruby-2.4.4/gems/activerecord-5.2.1/lib/active_record/reflection.rb:436:in `initialize'
The next #theforeman community demo is live now on Youtube - https://www.youtube.com/watch?v=BaEz47qF2xU - join us live and ask questions in our chat channel! #community
@sharvit
sharvit / 99-local.yaml
Created November 28, 2018 13:10
Forklift sshfs
---
centos7-devel:
primary: true
box: centos7
sshfs:
host_path: '/home/asharvit/Projects/theforeman/vagrant-shares/centos7-devel'
guest_path: '/home/vagrant'
reverse: True
ansible:
playbook: 'playbooks/devel.yml'
TASK [foreman_installer : Run installer] ***************************************
Wednesday 30 May 2018 15:39:49 +0300 (0:00:00.018) 0:03:59.454 *********
fatal: [centos7-devel]: FAILED! => {
"changed": true,
"cmd": "foreman-installer -v --scenario \"katello-devel\" --disable-system-checks --katello-devel-enable-ostree=true",
"delta": "0:00:15.385362",
"end": "2018-05-30 12:40:04.722483",
"rc": 1,
"start": "2018-05-30 12:39:49.337121"
}
@sharvit
sharvit / .eslintrc
Created March 4, 2019 07:42
.eslintrc file for foreman-plugins
{
"plugins": ["patternfly-react"],
"extends": ["plugin:patternfly-react/recommended"],
"rules": {
"prettier/prettier": ["error", {
"singleQuote": true,
"trailingComma": "es5"
}],
"import/no-unresolved": ["error", {
"ignore": ['foremanReact/.*']
@import '~bootstrap-sass/assets/stylesheets/bootstrap/_variables';
@import '~bootstrap-sass/assets/stylesheets/bootstrap/_mixins';
@mixin create-tasks-dashboard-column($columns: 12, $screen-min: 0, $gutter: $grid-gutter-width) {
@media (min-width: $screen-min) {
width: percentage(($columns / $grid-columns));
float: left;
position: relative;
min-height: 1px;
padding-right: ($gutter / 2);
@sharvit
sharvit / action.js
Last active April 30, 2019 11:48
API request action
export const fetchTasksSummary = time => {
const hours = timeToHoursNumber(time);
return {
type: API_REQUEST,
action: ACTIONS.GET,
url: `/foreman_tasks/tasks/summary/${hours}`,
subType: FOREMAN_TASKS_DASHBOARD_FETCH_TASKS_SUMMARY,
normalizeResponse: (data) => data.results[0],
normalizeError: error => error.message,
import React from 'react';
import { connect } from 'react-redux';
const AUDITS_API = 'AUDITS_API';
const createConstTypes = (constName) => {
return {
REQUEST: `${constName}_REQUEST`,
REQUEST: `${constName}_SUCCESS`,
REQUEST: `${constName}_FAILURE`,
---
centos7-devel:
primary: true
box: centos7
sshfs:
host_path: '/home/asharvit/Projects/theforeman/vagrant-shares/centos7-devel'
guest_path: '/home/vagrant'
reverse: True
ansible:
playbook: 'playbooks/devel.yml'

Tutorial adding npm dependencies

Foreman manage npm dependencies with a seperate project called [@theforeman/vendor] which responsible to deliver 3rd-party modules to foreman and its plugins. Foreman and its plugins consumes [@theforeman/vendor] project from npm in development and from rpm in production.

[@theforeman/vendor] lives inside a monorepo together with other foreman javascript tools in a project called [foreman-js].

In this tutorial you will learn how to add a new dependency to be available for foreman and it's plugins.